Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a chart and a text object in a sheet which needs to be exported to PPT (Please see the attachment).
The textbox is enabled when a particular filter is selected in the chart
For example: I have a bar chart with 3 bars A, B and C .
Text box is enables only when the user clicks on bar A.
I have to export this chart and the text box (whenever it is enabled) on the sheet to PPT. i.e.
-if the user selects bar A and then export the objects the the PPT should contain bar chart and the text box.
-If nothing is select in the bar chart only the bar chart needs to be exported to PPT
I was able to export the chart and the text box when it is enabled using the following Macro
Sub ExportPPT
ActiveDocument.ActiveSheet.FitZoomToWindow
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
with PPSlide.Shapes.Paste
.left = 90
.Top = 146
.Width=250
.height=250
end with
ActiveDocument.GetSheetObject("TX01").CopyBitmapToClipboard
with PPSlide.Shapes.Paste
.left = 90
.Top = 146
.Width=250
.height=250
end with
Set PPSlide = Nothing
Set PPPres = Nothing
End sub
But when the text box is not enabled it is exporting the same object copied earlier in the clipboard.
How will I test which text box is enabled when in my Macro??
In my report I have many such text boxes to be exported to PPT whenever they are enabled.
Hope I am clear on my part.
Thanks in Advance!.
Laxmi