Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macros not working in ajax, IE plugin but working in qv desktop

How to make it work?

20 Replies
Anonymous
Not applicable
Author

Here is the macro:

'Documentation Macro

sCR = Chr(13)

sLF = Chr(10)

sCRLF = sCR & sLF

sub exportToPowerpoint

  Set oPptApp = CreateObject("PowerPoint.Application")

  oPptApp.Visible = True

  Set oPres = oPptApp.Presentations.Add

  for i = 0 to ActiveDocument.NoOfSheets - 1

    set oSheet = ActiveDocument.Sheets(i)

    oSheet.Activate

    Application.WaitForIdle

    for j = 0 to oSheet.NoOfSheetObjects - 1

      Set oShtObj = oSheet.SheetObjects(j)

      if IsChartObj(oShtObj) then

        placeInPPT oPptApp, oPres, oShtObj  

      end if

    next 

   next

   oPptApp.SaveAs(ActiveDocument.GetProperties.FileName&".ppt")

   MsgBox("Export to Powerpoint done")

end sub

Anonymous
Not applicable
Author

I did that. The ppt opens but with no data.

Anonymous
Not applicable
Author

Did that. It just opens the power point but with no data. But works offline

jerrysvensson
Partner - Specialist II
Partner - Specialist II

It will NOT work in WebView.

As Alessandro wrote, you have done this?

Requested Module Security: System Access

Current local security: Allow System Access

If the user have been presented with the dialog requesting Module security and made the incorrect choice it will not work. Try changing your macro code, just add some dummy sub. It will give the user a new dialog requesting Module security.

The user have Powerpoint installed on their machine?

Anonymous
Not applicable
Author

yes I did:

Requested Module Security: System Access

Current local security: Allow System Access

Then when the dialog opens, I select Allow any macro.

Yes I have Power point Installed.

But it works in offline mode.

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Interesting problem.. 🙂

Add MsgBox("Export to Powerpoint begin") as the first line in your macro, to see if something works.

I often use Msgbox() for debugging.

Add your QlikView server to Trusted sites. Shouldn't make any difference though.

Anonymous
Not applicable
Author

Did the same. Msgbox() works in offline mode but not with ajax or IE plugin. Also added the access point to trusted sites. What next?

jerrysvensson
Partner - Specialist II
Partner - Specialist II

MsgBox() will not work in Ajax, but should work in plugin.

If you try:

sub dummy

     MsgBox "Hello world"

end sub

Does that work in plugin?

Anonymous
Not applicable
Author

Yes Msgbox is working on IE plugin but ppt generator macro isn't.

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Ok

Put MsgBoxes like this to see where it fails:

sub exportToPowerpoint

MsgBox("One")

Set oPptApp = CreateObject("PowerPoint.Application")

MsgBox("Two")

oPptApp.Visible = True

Set oPres = oPptApp.Presentations.Add

MsgBox("Three")

'And so on ..

or i = 0 to ActiveDocument.NoOfSheets - 1

set oSheet = ActiveDocument.Sheets(i)

oSheet.Activate

Application.WaitForIdle

for j = 0 to oSheet.NoOfSheetObjects - 1

Set oShtObj = oSheet.SheetObjects(j)

if IsChartObj(oShtObj) then

placeInPPT oPptApp, oPres, oShtObj

end if

next

next

oPptApp.SaveAs(ActiveDocument.GetProperties.FileName&".ppt")

MsgBox("Export to Powerpoint done")

end sub