Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i have a macro to export only charts to ppt.But, i want to export all objects(charts, tables, listboxes....etc) to ppt.
Can anyone help me out ..Its Urgent.
Regards,
Rathnam.
Hi Marcus,
Thanks for your reply.
ya...i am following the same link...the macros from the link are only exporting charts not the other objects from the sheet...but ,along with the charts i want to export other objects as well.
Regards,
Rathnam.
Hi Marcus,
i have the following script which will exporting all objects to ppt but not in a proper order..i want to export how i placed them in the sheet.
can u please check this and let me know.
This would be a great help to me.
Sub ExportPPT
ActiveDocument.ActiveSheet.FitZoomToWindow
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
Set PPSlide = objPresentation.Slides.Add(1,11)
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("CH13").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("TX37").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("IB17").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("IB18").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("IB19").CopyBitmapToClipboard
PPSlide.Shapes.Paste
ActiveDocument.GetSheetObject("IB20").CopyBitmapToClipboard
PPSlide.Shapes.Paste
Set PPSlide = PPPres.Slides.Add(1, 1)
Set PPSlide = Nothing
Set PPPres = Nothing
End sub
Regards,
Rathnam.
The macros from the link runs through all sheet-objects and have then a check if they are an chart. If you this removed or modified you get all objects.
- Marcus
ya i checked that...it is exporting only charts...not the other objects.
i am getting confused that where to change the code.
It will be possible to export all sheets-objects in order, sizing and position from the sheet but the effort will be enormous - what will be the additionally value in opposite to a sheet-print or a screenshot?
- Marcus
Hi MArcus,
i am here by attaching my app..please have look at it and modify the code to export all objects to ppt in aproper order.
i have demo with client tomorrow.
This would be a great help for me.
Regards,
Rathnam.
Sorry, but this made to much effort and the idea from the community is to help each other and not to make others work.
It's really a requirement for you you will need to spend the time which it needed ... I suggest you to find alternatives to such complex approaches - the aim from qlikview is to simplify and not make things complex again ...
- Marcus
Thank you Marcus...i will do it.
Hi Marcus,
Now i am able to export all objects to ppt.
But, still i have a problem.
i have a bar chart..in that if a user clicked on a particular bar related information will enabled.
i want a macro with the condition..if the selected dimension is "A" then export related objects else export other objects.
is there any way to achieve it.
Regards,
Rathnam.
You could for example read the selection per getfieldselections() in a variable and then use the following logic:
if var = condition then
export1
else
export2
end if
Here a code-examples from APIGuide.qvw for read such variable in macros or read the selection directly in macros:
set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)
set val=ActiveDocument.Fields("Month").GetPossibleValues
for i=0 to val.Count-1
msgbox(val.Item(i).Text)
next
sub LogFunktion
'This routine logs selection to a text file
set fso = CreateObject("Scripting.FileSystemObject")
set mypath = ActiveDocument.GetProperties
directory = mypath.MyWorkingDirectory
On Error Resume Next
' See if file already exists.
Set filFile = fso.GetFile(directory & "log.txt")
' If not, then create it.
If Err <> 0 Then
Set filFile = fso.CreateTextFile(directory & "log.txt")
End If
Set txsStream = filFile.OpenAsTextStream(8) 'For Appending
set doc = ActiveDocument
set mySelections = doc.fields("Field").GetSelectedValues
for i = 0 to mySelections.Count - 1
txsStream.WriteLine Now & " " & mySelections.Item(i).text
next
txsStream.WriteBlankLines 1
txsStream.Close
end sub
- Marcus