View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
StargateFan[_2_] StargateFan[_2_] is offline
external usenet poster
 
Posts: 12
Default Save sheet bitmap to desktop?

On Aug 17, 9:31*am, Don Guillett wrote:
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


Hi!

Admittedly, I'm not very good at doing the substitutions sometimes and
this one stumped me. I did the best I could and invoked the macro but
got an error 13 type mismatch code. Admittedly, the substitutions I
made don't look good:

Sub Create_GIF()
Dim fn As String
Dim mychart As Chart
fn = "\\CompanyName\Users\Reception\Desktop\Tod+Tom ." &
Range("B1:B4").Value & ".gif"
'MsgBox fn
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export Filename:=fn, FilterName:="GIF"
End Sub

(file name output hopefully would be Tod+Tom.gif)

How can I fix please?

Thanks!! :oD