ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

xls to png

<< < (5/5)

AndyM:
Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
    checked this again, either it quit working or never did, sorry
Something always worth trying is recording a macro.  I just recorded it again but this time selected "as printed".

It's been a while since I've used Excel daily.  Back then I would have either been able to quickly give you the basic code to save files, or looked at something similar I'd already done (more likely) and then modified it.

I don't even remember which spreadsheets had the good file-related code I was using, so I'll first try to record something to see if it jogs the memory.  I'll get back to you.
 

AndyM:
I realized that I had never seen (never needed) any "save selection" choices in Excel and Excel-specific VBA.  I started fooling with it and realized it was going to be more than a few lines.

So I googled "excel save selection as image" and got all sorts of interesting stuff, but more involved than I thought.  I'll use code I don't completely understand if I understand the purpose, input, and output of the chunks I don't get.  And if the code works right off, or with a little modification of the parts I do understand.

What you could also do is have Excel copy the selection as a bitmap to the clipboard, and then have the last line of the vba code call something else (an Autohotkey script, a batch file, etc).  This could all be run with just one click.

kunkel321:
@Andy:  No kidding!  I just found this http://office.microsoft.com/en-us/excel-help/file-formats-that-are-supported-in-excel-HP010014103.aspx  Apparently Excel 2007 has 13 different clipboard formats (21 if you count the different extensions). 

Navigation

[0] Message Index

[*] Previous page

Go to full version