Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Copy; Paste; Paste Special are disabled | Excel Discussion (Misc queries) | |||
'paste special', 'paste link' formatting transfer | Excel Discussion (Misc queries) | |||
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. | Excel Worksheet Functions | |||
Paste and Paste Special command are not enabled in Excel | Excel Worksheet Functions |