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

All:

Need assistance on macro code to do the following:

From a command button - copy a range from a worksheet (A1:D9), then save
selection as a bitmap (picture) on the desktop.

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Save as bitmap

Hi,

Try this :

Modify sheet name and range address at your convenient.

'--------------------------------------------
Sub Save_Range_On_Desktop()

Application.ScreenUpdating = False
With Sheets("Sheet1")
.Activate
Workbooks.Add
.Range("A2:H31").CopyPicture
End With
With ActiveSheet
.Paste
With .ChartObjects.Add(0, 0, _
Selection.Width, Selection.Height).Chart
.Paste
.ChartArea.Border.LineStyle = 0
End With
With .ChartObjects(1)
.Top = 0
.Left = 0
.Chart.Export "C:\Users\DM\Desktop\Its_Name.bmp", "bmp"
End With
.Parent.Close False
End With
Application.ScreenUpdating = True
End Sub
'--------------------------------------------

"Maze" a écrit dans le message de groupe de discussion :
...
All:

Need assistance on macro code to do the following:

From a command button - copy a range from a worksheet (A1:D9), then save
selection as a bitmap (picture) on the desktop.

Thank you in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save as bitmap

Thank you for responding - is there anything else I need to do, I keep
getting a Syntax error, starting on the first .Activate

"michdenis" wrote:

Hi,

Try this :

Modify sheet name and range address at your convenient.

'--------------------------------------------
Sub Save_Range_On_Desktop()

Application.ScreenUpdating = False
With Sheets("Sheet1")
.Activate
Workbooks.Add
.Range("A2:H31").CopyPicture
End With
With ActiveSheet
.Paste
With .ChartObjects.Add(0, 0, _
Selection.Width, Selection.Height).Chart
.Paste
.ChartArea.Border.LineStyle = 0
End With
With .ChartObjects(1)
.Top = 0
.Left = 0
.Chart.Export "C:\Users\DM\Desktop\Its_Name.bmp", "bmp"
End With
.Parent.Close False
End With
Application.ScreenUpdating = True
End Sub
'--------------------------------------------

"Maze" a écrit dans le message de groupe de discussion :
...
All:

Need assistance on macro code to do the following:

From a command button - copy a range from a worksheet (A1:D9), then save
selection as a bitmap (picture) on the desktop.

Thank you in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Save as bitmap

Danses pour le groupe avancé

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Save as bitmap

For prereceding version of excel 2007
Menu bar / tools / Macros or procedures / Security / approved editors /
you have to check the 2 checkboxes in the button of the window.

Excel 2007,
Office button / Options Excel / Confidentiality gestion center / Parameters /
Macro parameters / and you have to check the case : Approved access ... vba project

These informations have been translated from a french version...
sorry if the command name button have a different caption than those used.



"Maze" a écrit dans le message de groupe de discussion :
...
Thank you for responding - is there anything else I need to do, I keep
getting a Syntax error, starting on the first .Activate

"michdenis" wrote:

Hi,

Try this :

Modify sheet name and range address at your convenient.

'--------------------------------------------
Sub Save_Range_On_Desktop()

Application.ScreenUpdating = False
With Sheets("Sheet1")
.Activate
Workbooks.Add
.Range("A2:H31").CopyPicture
End With
With ActiveSheet
.Paste
With .ChartObjects.Add(0, 0, _
Selection.Width, Selection.Height).Chart
.Paste
.ChartArea.Border.LineStyle = 0
End With
With .ChartObjects(1)
.Top = 0
.Left = 0
.Chart.Export "C:\Users\DM\Desktop\Its_Name.bmp", "bmp"
End With
.Parent.Close False
End With
Application.ScreenUpdating = True
End Sub
'--------------------------------------------

"Maze" a écrit dans le message de groupe de discussion
:
...
All:

Need assistance on macro code to do the following:

From a command button - copy a range from a worksheet (A1:D9), then save
selection as a bitmap (picture) on the desktop.

Thank you in advance.

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
how to save an image as a bitmap milkb1 Excel Programming 0 July 12th 07 04:46 PM
Bitmap Ed Excel Discussion (Misc queries) 2 January 26th 07 02:12 AM
Save Userform as bitmap [email protected] Excel Programming 2 June 19th 06 04:06 PM
Bitmap manipulation from VBA/VB John Keith[_2_] Excel Programming 2 September 20th 05 07:57 PM
Bitmap Macca Excel Programming 0 October 26th 04 09:43 AM


All times are GMT +1. The time now is 11:45 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"