Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save sheet bitmap to desktop?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Save sheet bitmap to desktop?

On Wed, 17 Aug 2011 06:31:48 -0700 (PDT), 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


I get a mismatch 13 error, again.

This time I didn't change anything other than the range (leaving the
formula as is gave me another error altogether and nothing happened):

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

The fn="c:\a\" ... line is highlighted in the debugger.

So I tried going back to some sort of basics. Using set mychart line
I got from the above code, googling came to this example:

http://answers.yahoo.com/question/in...1092437AAeLVto
Sub Create_GIF_of_workbook()
Dim mychart As Chart
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export FileName:="P:\0DESKTOP\TOD+TOM.gif", FilterName:="GIF"
End Sub

But again error. This time 1004, Unable to get ChartObjects property
of the worksheet class.

All other attempts have failed so far. Help!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Save sheet bitmap to desktop?

On Wed, 17 Aug 2011 19:12:46 -0400, StargateFan
wrote:

On Wed, 17 Aug 2011 06:31:48 -0700 (PDT), 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


I get a mismatch 13 error, again.

This time I didn't change anything other than the range (leaving the
formula as is gave me another error altogether and nothing happened):

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

The fn="c:\a\" ... line is highlighted in the debugger.

So I tried going back to some sort of basics. Using set mychart line
I got from the above code, googling came to this example:

http://answers.yahoo.com/question/in...1092437AAeLVto
Sub Create_GIF_of_workbook()
Dim mychart As Chart
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export FileName:="P:\0DESKTOP\TOD+TOM.gif", FilterName:="GIF"
End Sub

But again error. This time 1004, Unable to get ChartObjects property
of the worksheet class.

All other attempts have failed so far. Help!


Hey, just realized something is sticking out like sore thumb, I have
an excel spreadsheet and not a chart. Why the line:

Set mychart = ActiveSheet.ChartObjects(1).Chart
??

Is that where problem lies?

I need this:

Range("B1:B4").CopyPicture Appearance:=xlScreen, Format:=xlBitmap

to be saved to desktop as

P:\0DESKTOP\TOD+TOM.gif

Is the chart reference best way? Thanks once again.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save sheet bitmap to desktop?

[snip]

1) *It saves a GIF of the range B1:B4, yes, but drags the chart
background with it. *Can the range itself be the only thing *exported,
by any chance? *Would the parameters in oRange.CopyPicture xlScreen,
xlPicture be the culprits (xlScreen???).

2) *Error capture re path possible? *If desktop is not P:\0DESKTOP\,
as when I do this at work where desktop at different location, any way
to prompt user to change path?


Hi, everyone. I have tried to fix this myself but I have had no
luck. On the code above, is there _any_ way to JUST get the range
exported? The export includes what must be a temporary chart
background.

Secondly, any error correction possible on the path?

Thank you!

:oD
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save as bitmap Maze[_2_] Excel Programming 6 January 11th 10 07:10 PM
save as - to any desktop Driftwood Excel Programming 2 July 28th 09 04:35 PM
how to save an image as a bitmap milkb1 Excel Programming 0 July 12th 07 04:46 PM
Save Userform as bitmap [email protected] Excel Programming 2 June 19th 06 04:06 PM
Save .xls as .txt In DeskTop Antonyo[_2_] Excel Programming 3 July 18th 05 01:52 PM


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"