srikandi2000
Member
Hi all,
I am trying to copy chart/shape from excel to powerpoint and save it as different files based on region. It is working fine, but somehow when I save it as a single file, the powerpoint app close, while in different files it is not. Here is the sample code that does not working
which I modified from this which is working
Any idea why? Thanks in advance
I am trying to copy chart/shape from excel to powerpoint and save it as different files based on region. It is working fine, but somehow when I save it as a single file, the powerpoint app close, while in different files it is not. Here is the sample code that does not working
Code:
Set oPS = Nothing
oPP.PageSetup.SlideSize = ppSlideSizeOnScreen
oPP.SaveAs ThisWorkbook.Path & "\" & FileName & ".pptx"
oPP.Close
Next i
oPA.Quit
ActiveWorkbook.Sheets(1).Select
If Not oPS Is Nothing Then Set oPS = Nothing
If Not oPP Is Nothing Then Set oPP = Nothing
If Not oPA Is Nothing Then Set oPA = Nothing
which I modified from this which is working
Code:
Set oPS = Nothing
oPP.SaveAs ThisWorkbook.Path & "\" & NmFile & ".pptx"
oPP.Close
oPA.Quit
ActiveWorkbook.Sheets(1).Select
If Not oPS Is Nothing Then Set oPS = Nothing
If Not oPP Is Nothing Then Set oPP = Nothing
If Not oPA Is Nothing Then Set oPA = Nothing
Any idea why? Thanks in advance