Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to make it work?
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
I did that. The ppt opens but with no data.
Did that. It just opens the power point but with no data. But works offline
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?
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.
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.
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?
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?
Yes Msgbox is working on IE plugin but ppt generator macro isn't.
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