View Full Version : Need quick help with some VBA issues (image sizing)

03-24-2011, 10:04 AM
Hopefully you guru's can help me on this one. I am making a macro in excel to export a image created by excel into powerpoint, and then have it save as a .png image.

I have the macro fully functional.. But the .png image. The image size I am getting is 720x540 and I was really hoping for a higher res image. This is what I have:

'Save as .png file
For Each sld In pwPnt.ActivePresentation.Slides
Call sld.Export(SavePathCell & "7-Day_Forecast-Extended-Outlook.png", "PNG")

'Archive .png file
For Each sld In pwPnt.ActivePresentation.Slides
Call sld.Export(SavePathCell2 & SaveNameCell & " - " & Format(Now(), "yyyymmdd") & " - " & Format(Now(), ("hhmm - ")) & opinit & ".png", "PNG")

Thanks so much for your help!!!

03-24-2011, 10:16 AM
Just to clarify is your request in the end just to convert images to png? Or is there more to it?

03-24-2011, 10:19 AM
It already converts it... I just want to make the file bigger than 720x540

The image is going to be blown up, and it distorts really bad at 720x540.

So I am trying to solve this issue.

03-24-2011, 10:26 AM
I tried switching to .gif and .bmp with the same results... ideas?

03-24-2011, 10:35 AM
If you blow up the original that is on excel does it distort badly also? How is the image being created in excel? Could you upload an example?

03-24-2011, 11:01 AM
No it does not... This is the image that is being converted... It is plenty big.

03-24-2011, 01:36 PM
Are you only using powerpoint for its save as image feature?

If so I found code to export a range to a picture http://www.xcelfiles.com/VB_Quick17.html which might once modified be much better for you.

I tested this and it looks good. The output of my test is attached.