Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pinky1234
Contributor III
Contributor III

Need Macro Help

Hello,

Please find my attached Qvw. You see two charts which is Sales and Revenue charts. There is a button which will export those two charts to PowerPoint.

I am looking for option before exporting to power point, it should prompt me with the charts names which is Sales and Revenue charts to select the report name.

Based on selection that charts should export to PPT. If i select revenue then Revenue chart should export to PPT.

Can you please help me with the Macro that i am looking for my Dashboard.

Regards,

Pinky

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

You can fiddle with the top, left, width and height:

View solution in original post

8 Replies
m_woolf
Master II
Master II

I didn't do exactly what you asked for.

pinky1234
Contributor III
Contributor III
Author

Thanks for the reply!

But i am looking for option before exporting to power point it should prompt me with the list box or what ever object it is with the report names So that i can choose which chart i need to export.

Can anyone help on this?

pinky1234
Contributor III
Contributor III
Author

Can anyone help on this?

Regards,

Pinky

pinky1234
Contributor III
Contributor III
Author

Can anyone respond to this? Please let me know if this not possible in Qlikview also let me know if you have any questions.

Requirement:

I am looking for option before exporting to power point it should prompt me with the list box or what ever object it is with the report names So that i can choose which chart i need to export.

pinky1234
Contributor III
Contributor III
Author

I am fine with your solution. But one more change, if i click sales export button it should export chart and below table same thing for Revenue also. If i click Revenue Export Button should export both chart and Table.

I have attached Qvw. Please find the attached Qvw and let me know how can i implement ?

I really appreciate your help!Thanks

Pinky

m_woolf
Master II
Master II

You can fiddle with the top, left, width and height:

pinky1234
Contributor III
Contributor III
Author

Thanks for your reply. Small correction. I want to export Both charts. The one you see the table box under Barchart is Pivot tables comes under charts.

if strExport = "Sales" then

strTitle = "Total Sales"

strCHID = "CH01"

strTBID = "TB01"

else

strTitle = "Total Revenue"

strCHID = "CH02"

strTBID = "TB01"

If i want to export "CH01" and "CH03" charts to power point if str Export ="Sales". Please find the attached Qvw and let me know.Thanks!

trdandamudi
Master II
Master II

I made the change to your code and here it is: What ever lines in bold are the lines that I added to your code:

Sub ExportPPT
Set v = ActiveDocument.Variables("vExport")
strExport = v.Getcontent.string

Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
Set PPSlide = objPresentation.Slides.Add(1,11)
set up = ActiveDocument.GetApplication.GetUserPreferences
up.ChartUseCapNBorder = True
ActiveDocument.GetApplication.SetUserPreferences up

if strExport = "Sales" then
strTitle = "Total Sales"
strCHID = "CH01"
strCHID2 = "CH03"
strTBID = "TB01"
else
strTitle = "Total Revenue"
strCHID = "CH02"
strTBID = "TB01"
end if

with objPresentation.Slides(1).Shapes(1)
.TextFrame.TextRange = strTitle
.Left = 100
.top = 45
.width=500
.height=20
end with
ActiveDocument.Sheets("SH01").Activate
ActiveDocument.GetSheetObject(strCHID).CopyBitmapToClipboard
with objPresentation.Slides(1).Shapes.PasteSpecial(PasteHTML)
.Left = 50
.top = 50
.width=300
.height=100
end with

ActiveDocument.Sheets("SH01").Activate
ActiveDocument.GetSheetObject(strCHID2).CopyBitmapToClipboard
with objPresentation.Slides(1).Shapes.PasteSpecial(PasteHTML)
.Left = 50
.top = 200
.width=300
.height=100
end with

ActiveDocument.GetSheetObject(strTBID).CopyBitmapToClipboard
with objPresentation.Slides(1).Shapes.PasteSpecial(PasteHTML)
.Left = 50
.top = 400
.width=350
.height=100
end with
'ActiveDocument.GetSheetObject("CH02").CopyBitmapToClipboard
'with objPresentation.Slides(1).Shapes.Paste
' .Left = 500
' .top = 100
' .width=700
' .height=250
'end with

Set PPSlide = Nothing

Set PPPres = Nothing

End sub