Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
amber2000
Creator
Creator

Macro Export To Excel doesn't work on local version

Hello Everyone,

I created a macro that Exports Document objects to Excel (I used the code from Stefan Walther as example)

Sub ExportToExcel_Evaluations

Dim aryExport(3,3)

aryExport(0,0) = "CS09"                    '//ID of the Qlikview object to copy from

aryExport(0,1) = "Evaluations"            '//Name of the Sheet in Excel where the object should be copied to

aryExport(0,2) = "A1"                          '//Range in Excel where the object should be pasted to

aryExport(0,3) = "data"                          '//Copy & paste Mode  (data, Image)

aryExport(1,0) = "CH31"

aryExport(1,1) = "Evaluations"

aryExport(1,2) = "A15"

aryExport(1,3) = "data"

aryExport(2,0) = "CH11"

aryExport(2,1) = "Jobs by date"

aryExport(2,2) = "A1"

aryExport(2,3) = "data"

Dim objExcelWorkbook 'as Excel.Workbook

Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)

End Sub

Then on the Button Properties --> Actions I chose Run Macro and in Macro Name I placed the name of the macro: ExportToExcel_Evaluations

When I klik the button the Edit Macro window opens and that's all.

Does anyone know what I've done wrong?

Monique

12 Replies
sasiparupudi1
Master III
Master III

You could try something like

Sub x()
RemoveSheet "Sheet"
End Sub


Sub RemoveSheet(SheetPrefix)

For Each oSheet In ActiveWorkbook.Sheets
'MsgBox oSheet.Name
If Left(oSheet.Name, 5) = SheetPrefix Then
oSheet.Delete
End If
Next
End Sub

MK9885
Master II
Master II

Are you aware that many Macros don't run on server or Access Point?

If your users will access the application in Access Point then you should first test it on server, cus it didn't work for me.

Sometimes Macros don't run in Safe Mode...

Change it to below and try again?

Capture.PNG

amber2000
Creator
Creator
Author

Hi Aehman,

This didn't work either, even opening in IE instead of Ajax environment didn't help.

I think I have to accept that I can't use Macro's for End Users at all

Your help was much appreciated.

Monique