Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
SteveZheng
Contributor
Contributor

Qlikview Macro call Excel macro doesn't work in Wins10

Hello,

I used to use a qlikview macro to call an excel macro which will perform a certain task in excel in win 7. It worked fine. However since I switched to Win 10, it didn't work any more. The Qlik macro will stop at "oSH.Application.Run "GetSheetsAR" and error message said : "Cannot run the macro 'GetSheetsAR'. The macro may not be available in this workbook or all macros may be disabled."

I went to the excel trusted center and enable the macro settings, but it still didn't work. I also tried add trusted locations in excel, still not work. 

I wonder if anyone has the same issue and is there any solution here? 

(the excel macro AR.xlsm works fine if I manually run it). 

Thanks a lot,

Steve

This is Qlikview macro below:

Sub AR
Set oXL=CreateObject("Excel.Application")
f_name="C:\Users\Public\Documents\NPrinting\Output_AR\MonthlyReconcile\AR.xlsm"
Set oWB=oXL.Workbooks.Open(f_name)
Set oSH=oWB.Worksheets.Item(1)
oSH.Application.Run "GetSheetsAR"
'oWB.Save
'oWB.Close
Set oSH=nothing
Set oWB=nothing
Set oXL=nothing
End Sub

11 Replies
marcus_sommer

I agree with Mwoolf that's rather unlikely that there is a problem with the code itself or with the OS else with the various security settings within Excel. A few weeks ago I bought a new laptop with a pre-installed office. Activating it was no problem and everything worked like expected unless various macro-stuff which I couldn't enable regardless how I tried (and I doubt that I missed the essential settings and assume the cause within the system-user who was used to install the office).

My solution was to re-install a new office over my installation, deinstalled it at once and installed it again. After that everything worked smoothly again. Maybe it's helpful in any way.

- Marcus

Brett_Bleess
Former Employee
Former Employee

The only other thing that comes to mind that I have not seen mentioned would be a Group Security Policy that is catching things, but I would almost surmise that should prevent you from running things manually as well, but Windows may be treating that scenario differently as well.  Just wanted to toss this out in addition to Marcus and the other poster's comments.  Your best bet in this case might be to show someone on your Active Directory team or Security team what is going on to see if anything rings a bell with them.  Oh, the only other thing we forgot here is if by chance things are being run by a different account, the macro security may not be allowed, but then I remembered things are running, just failing on the one line, so I do not believe that is the case here.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.