Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
Highlighted
Not applicable

Excel macro sorting

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.

mwoolf
Honored Contributor II

Excel macro sorting

Try something like this:

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

Not applicable

Re: Excel macro sorting

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.