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

Run export macro using Accesspoint

Hi All,

I have created a Qlikview document which uses a macro to save out some variables to an excel spreadsheet.

It works fine when used in the Qlikview client, but will not work when used from AJAX over the server.

The spreadsheet which is used to save the data into is located on the Qlikview server itself and all paths are referenced correctly.

Any ideas how to get this macro to work?

Thanks

Dan

My macro code:

Sub SaveToExcelSheet


'Define file paths

f_name = "\\wapp07\supply$\maximo\Security2.xls"

Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(f_name)
Set oSH = oWB.Worksheets("Data")

'Copy the qlikview input variables into VB variables

Set VB_DATE = ActiveDocument.Variables("V_DATE")

'Discover the next empty row in the excel file

VB_NEXTEMPTYROW = oXL.WorksheetFunction.CountA(oSH.Columns("A:A"))

'Save out the variables into the empty row

oSH.Cells(VB_NEXTEMPTYROW +1 ,1).Value = VB_DATE.GetContent.String

'Save and close the excel file in the background

oWB.Save
oWB.Close
oXL.Quit


End Sub

1 Reply
jerrysvensson
Partner - Specialist II
Partner - Specialist II

Have you checked the box "Allow unsafe macro execution on server" ? It is in System/QlikView servers/Security