View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Save sheet bitmap to desktop?

On Aug 17, 7:52*am, StargateFan wrote:
I have this macro which is invoked by pressing a button:

Sub Msg_CellsToBitmap()
'
* * Application.CutCopyMode = False
' * *Range(ActiveCell.Address,
ActiveCell.End(xlDown).Address).Select * * ' incorrect copy function;
need "copy to bitmap"
* * Range("B1:B4").CopyPicture Appearance:=xlScreen, Format:=xlBitmap
'================================================= ===================
* * MyMsgBox = MsgBox("The cells have been sent to the clipboard as an
image." & vbCrLf & vbCrLf & _
* * * * * * * * * * * "(Retrieve from the clipboard with, i.e., ^v
shortcut.) * * ", vbOKOnly + vbInformation, "DONE ...")
End Sub

Rather than saving the file manually, is there a way to save that
image to a bitmap on the desktop, with desktop destination as:

\\companyName\Users\Reception\Desktop\Tod+Tom.bmp

Thanks! *:oD

Modify to suit

Sub Create_GIF()
Dim fn As String
Dim mychart As Chart
fn = "c:\a\" & Range("a1").Value & ".gif"
'MsgBox fn
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export Filename:=fn, FilterName:="GIF"
End Sub