Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Fix charts as embedded pictures

Hi,

Small example

Sub ChartsToPictures()

Dim objCht As ChartObject
Dim shtTemp As Worksheet

For Each shtTemp In ActiveWorkbook.Worksheets
For Each objCht In shtTemp.ChartObjects
objCht.CopyPicture xlScreen, xlPicture
shtTemp.Paste
With shtTemp.Shapes(shtTemp.Shapes.Count)
.Left = objCht.Left
.Top = objCht.Top
End With
objCht.Delete
Next
Next

End Sub



Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"iperlovsky" wrote in message
...
I am currently using the following macro to fix all values in the workbook
and then delete certain tabs. I recently added 5 charts to the tab I want
to
keep and was wondering if anyone knows how to fix the charts on that tab
as
embedded picture files in the worksheet. Any suggestions on how to modify
the
following routine, in particular the part that fixes all values to include
fixing the charts as embedded pictures, is appreciated.

Sub fixAll()
Application.DisplayAlerts = False
For i = 11 To Sheets.Count
With Sheets(i)
.UsedRange.Value = .UsedRange.Value
End With
Next i

Sheets([Transpose(Row(1:10))]).Delete

Application.DisplayAlerts = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Fix charts as embedded pictures

Thanks, that worked perfectly.

"Andy Pope" wrote:

Hi,

Small example

Sub ChartsToPictures()

Dim objCht As ChartObject
Dim shtTemp As Worksheet

For Each shtTemp In ActiveWorkbook.Worksheets
For Each objCht In shtTemp.ChartObjects
objCht.CopyPicture xlScreen, xlPicture
shtTemp.Paste
With shtTemp.Shapes(shtTemp.Shapes.Count)
.Left = objCht.Left
.Top = objCht.Top
End With
objCht.Delete
Next
Next

End Sub



Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"iperlovsky" wrote in message
...
I am currently using the following macro to fix all values in the workbook
and then delete certain tabs. I recently added 5 charts to the tab I want
to
keep and was wondering if anyone knows how to fix the charts on that tab
as
embedded picture files in the worksheet. Any suggestions on how to modify
the
following routine, in particular the part that fixes all values to include
fixing the charts as embedded pictures, is appreciated.

Sub fixAll()
Application.DisplayAlerts = False
For i = 11 To Sheets.Count
With Sheets(i)
.UsedRange.Value = .UsedRange.Value
End With
Next i

Sheets([Transpose(Row(1:10))]).Delete

Application.DisplayAlerts = True
End Sub


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
converting pictures to embedded object K Excel Discussion (Misc queries) 1 October 8th 08 02:09 PM
Embedded pictures kirkm[_7_] Excel Programming 2 August 23rd 07 09:39 AM
Embedded pictures in VBA JacMar Excel Discussion (Misc queries) 3 February 15th 07 04:12 AM
Are pictures in headers embedded or linked? Debbie Excel Discussion (Misc queries) 1 November 4th 06 11:06 PM
how do I delete thousands of pictures that are somehow embedded i. Jim Harris Excel Discussion (Misc queries) 4 February 25th 05 02:24 PM


All times are GMT +1. The time now is 04:55 PM.

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"