Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro won't run from Accesspoint

Hi all,
I'm trying to run this macro from Accesspoint, but it won't run. It runs fine when not in Accesspoint.
Any ideas?
Sub
set
val=ActiveDocument.Fields("RecID").GetPossibleValues
for
i=0 to val.Count-1
next
if
VarHolder1 > 1 then
msgbox
("More than one record is showing.  Refine your selection to select only one index.")
exit
sub
else
end
if
Set
oXL=CreateObject ("Excel.Application")
set
doc = ActiveDocument
set
mySelection = doc.fields("RecID").GetSelectedValues
for
i = 0 to mySelection.Count -1
next
set
vCommentsToExcel = ActiveDocument.Variables("vName")
String
set
vCommentsToExcel = ActiveDocument.Variables("vGrade")
String
set
temp = ActiveDocument.GetApplication.GetProperties
mid
(temp.UserName,4)
"\\TEST\QV_Development\Excel Loads\Comments.xls"
oWB = oXL.Workbooks.Open(f_name)
set
oSH = oWB.Worksheets.Item(1)
"a1:a50"
)
Set
c = .Find(strIndex, , , 2, 1, 2, 0)
If
Not c Is Nothing Then
Do
Set
c = .FindNext(c)
Loop
While Not c Is Nothing And c.Address <> firstAddress
End
If
End
With
if
VarHolder = 1 then
msgbox
("There already is a record for this item. If you want to change the note, delete it first.")
set
oSH = Nothing
set
oWB = nothing
set
oXL = nothing
set
v = ActiveDocument.Variables("vName")
""
,true
exit
sub
else
"A65536"
).End (-4162).Offset(1,0).FormulaR1C1 = strIndex
"A65536"
).End (-4162).Offset(0,1).FormulaR1C1 = VarHolder1
"A65536"
).End (-4162).Offset(0,2).FormulaR1C1 = VarHolder2
f_name="False" then
Set
oXL=nothing
Exit
sub
End
If
Set
oSH=nothing
Set
oWB=nothing
Set
oXL=nothing
set
v = ActiveDocument.Variables("vName")
""
,true
msgbox
("Record added")
end
if
End
Sub
If
set
1 Reply
billbois
Creator
Creator

There's nothing wrong with your macro.  It has to do with security on the server.  See this article for details:  http://qlikviewtips.wordpress.com/2011/10/17/is-possible-make-macros-that-run-server-side/