Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Paste special in VB

HI i'm trying to paste all the chart that exsits in the workbook one sheet ,
the method is working but some times i get "'run time error '1004'" .
Any idea what i'm doing wrong?
Here is the method that do it :

Sub ChangeGraphsToPhotos(Wbk1 As Workbook)
'wsheet = Nothing
Dim wsheet As Worksheet
Dim FileName As String
Dim ch As Chart

i = 1
j = 1
'This code works fine for chart sheets
FileName = Wbk1.FullName
Wbk1.Close SaveChanges:=True
Set Wbk1 = Nothing
Set Wbk1 = Application.Workbooks.Open(FileName)

Set wsheet = Wbk1.Worksheets.Add

For Each ch In Wbk1.Charts
'Application.CutCopyMode = False

If Not (InStr(ch.name, "Summary") < 0) Then
ch.ChartArea.Copy

End If
wsheet.PasteSpecial Format:="Picture (PNG)", Link:=False, _
DisplayAsIcon:=False


wsheet.Shapes(i).ScaleHeight 0.5, msoFalse
wsheet.Shapes(i).ScaleWidth 1, msoFalse

wsheet.Shapes(i).Top = j
wsheet.Shapes(i).Left = 1
i = i + 1
j = j + 250
End If
Next ch
wsheet.name = "RT_Graphs"
wsheet.Move befo=Wbk1.Worksheets(1)

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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
'paste special', 'paste link' formatting transfer jrebello Excel Discussion (Misc queries) 2 July 25th 07 08:46 AM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
Paste and Paste Special command are not enabled in Excel mcalder219 Excel Worksheet Functions 0 April 26th 06 06:57 PM


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