Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excel macro sorting

I have a VBScript in Qv like below calling an excel macro in which there is a sorting function. This excel macro runs without any problem in MS Excel. However, when Qv calls this this excel macro (like below), sorting function in it does not work. Any idea?

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open("path\test.xlsm")
objWorkbook.Application.Run "macro()"
3 Replies
Not applicable
Author

Hi,

In the macro script module did you set "Module Security" to allow system access? Please check.

If you set and still not working post the sample app with excel.

Cheers.

m_woolf
Master II
Master II

Try something like this:

objWorkbook.Application.Run('test.xlsm'!macro)

Not applicable
Author

Didnt work. Any way, I moved the sorting function to Qv. The problem fixed, for now. For your info, I can run the macro. The only problem is the sorting part inside the macro. When the macro is called externally, like by Qv, the sorting function in it is neglected.