Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to resolve macro parse failed when running it to the browser?

Hi,

I really don't know how to resolve this one,

macroparse.png

Note that, when I run it in the Qlikview Application/locally, there's no error found. But when I run/view it in the web, that message found! How can I eliminate or avoid or remove this one? I need help asap.

Thanks for your ideas,

Bill

1 Solution

Accepted Solutions
Not applicable
Author

Hi Bram,

Good day!

The solution is that, when having macros, this will run good in IE Plugin.

So far, the script for macros is working great!

Thanks,

Bill

View solution in original post

12 Replies
Anonymous
Not applicable
Author

You can add some Msgbox() :es in your code to see where the macro parsing fails to figure out what command is messing up the execution for you.

Not applicable
Author

there's no error when you run it locally...

erichshiino
Partner - Master
Partner - Master

Hi,

You can include some msgbox() in the middle of the code for debug in the browser...

If you add some of them you can isolate the lines where the error occurs.

You can also post you code here so we can take a look and try to identify the problem

Regards,

Erich

Bill_Britt
Former Employee
Former Employee

What version of QVS are you running?

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Not applicable
Author

For our users this means they chose the wrong permission settings the first time they opened the document.  I have seen posts where people edited a registry setting for this but..... we simply open the settings.ini on the users computer and remove the part that records macro setting information.

EX:

[Module Checksums System]

E5D6D693-5357DBA0-779BD929-7EA91536-C9F92288=

8A2886FD-014D95FC-89430C6E-927D45DB-E6B48BAD=

...

We remove the entire section about Module Checksums System.  Next entry of the document then gives a chance to set them again.  We typically set them for them at this point so we don't have to do this again.

Win7 location for settings.ini is under c:\users\username\appdata\...\qliktech\qlikview

WinXP location is c:\documents and settings\.....\qliktech\qlikview

HTH

Not applicable
Author

THIS LINES OF CODES WORK WHEN I RUN MY QLIKVIEW LOCALLY, BUT WHEN I PUT IT ON THE SERVER, THE ERROR OCCURS

WHAT I WANT HERE IS THAT, SEND THE QVREPORTS INTO ONE EXCEL, EACH REPORTS HAS ONE SEPARATED SHEET

============================================================================

on error resume next

sub launchXL

          set oXL=CreateObject("Excel.Application")

          oXL.visible=True

          oXL.Workbooks.Add

          '---------------------------------------

          aSheetObj=Array("MAgo26","MAgo25","MAgo24","MAgo23","MAgo22","MAgo21","MAgo20","MAgo19","MAgo18","MAgo17","MAgo16","MAgo15","MAgo14","MAgo13","MAgo12","MAgo11","MAgo10","MAgo9","MAgo8","MAgo7","MAgo6","MAgo5","MAgo4","MAgo3","MAgo2","MAgo1")

          '---------------------------------------

          for i=0 to UBound(aSheetObj)

                    oXL.Sheets.Add

                    Set oSH = oXL.ActiveSheet

                    'Getting the QView variable

                    vCompany = ActiveDocument.Variables("vCompany").GetContent.String

                    vTM = ActiveDocument.Variables("vTM").GetContent.String

                    'vLM = ActiveDocument.Variables("vLM").GetContent.String

                    oXL.ActiveWorkbook.ActiveSheet.Cells(1, 1).Value = vCompany

                    oXL.ActiveWorkbook.ActiveSheet.Range("A1:F1").Merge

                    if i >= 0 and i <= 16  then 'MAgo 10 to MAgo26

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Sales Analysis by District by Customer"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM & " vs MAgo"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                    end if

                    if i = 17 then 'MAgo 9

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Sales Analysis by District by SKU"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM & " vs MAgo"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = "Ranked by Volume"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(5, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A5:F5").Merge

                    end if

                    if i = 21 or i = 20 or i = 19 or i = 18 then 'MAgo 5 to MAgo8

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Comparative Sales Volume by Customers"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM & " vs MAgo"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                    end if

                    if i = 22 then 'MAgo 4

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Sales Analysis by Division by SKU"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM & " vs MAgo"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = "Ranked by Volume"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(5, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A5:F5").Merge

                    end if

                    if i = 23 then 'MAgo 3

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Comparative Sales Volume by Customers (Top 100)"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM & " vs MAgo"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                    end if

                    if i = 24 then 'MAgo 2

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Sales Analysis"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                    end if

                    if i = 25 then 'MAgo 1

                              oXL.ActiveWorkbook.ActiveSheet.Cells(2, 1).Value = "Sales Analysis"

                              oXL.ActiveWorkbook.ActiveSheet.Range("A2:F2").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(3, 1).Value = vTM

                              oXL.ActiveWorkbook.ActiveSheet.Range("A3:F3").Merge

                              oXL.ActiveWorkbook.ActiveSheet.Cells(4, 1).Value = ActiveDocument.GetSheetObject(aSheetObj(i)).GetCaption.Name.v

                              oXL.ActiveWorkbook.ActiveSheet.Range("A4:F4").Merge

                    end if

              oSH.Range("A6").Select

              Set obj = ActiveDocument.GetSheetObject(aSheetObj(i))

              obj.CopyTableToClipboard True

              oSH.Paste

              sCaption=obj.GetCaption.Name.v

              set obj=Nothing

                    oSH.Rows("1:1").Select

                    oXL.Selection.Font.Bold = True

              oSH.Cells.Select

              oXL.Selection.Columns.AutoFit

              oSH.Range("A6").Select             

                    oSH.Name=left(sCaption,30)

                    set oSH=Nothing

          next

          '---------------------------------------

          set oXL=Nothing

end sub

Not applicable
Author

I tried but still the same error found in the browser

erichshiino
Partner - Master
Partner - Master

Hi,

Since your running your macro with a visible Excel instance(   oXL.visible=True), can you identify the point of error based on the results?

I'd include some msgbox() near these lines:

              obj.CopyTableToClipboard True

              oSH.Paste

They are probably the most probable points of failure

Regards,

Erich

Bill_Britt
Former Employee
Former Employee

Billringer,

What version of QV server are you running?

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.