Does anybody have an idea why i'd get an error when trying to apply a theme?
"The specified dimension is not valid for the current chart type"
occurs at newwb.applytheme ("c:\data-dump\Mytheme.thmx"
here's the entire story, it was suggested that I start a separate thread.Application.ScreenUpdating = False Dim rngUV As Range Dim rngImp As Range Dim rngx As Range 'clears non-numeric cells ActiveWorkbook.Sheets("Flighting").Range("B:D").SpecialCells(xlCellTypeFormulas, xlTextFormat).ClearContents 're-defines the graph range With ActiveWorkbook.Sheets("Flighting") Set rngx = Range("B12", Range("b12").End(xlDown)) Set rngUV = Range("c12", Range("c12").End(xlDown)) Set rngImp = Range("d12", Range("d12").End(xlDown)) End With With Sheets("Dashboard").ChartObjects("Chart 3") .Chart.SeriesCollection(1).XValues = rngx .Chart.SeriesCollection(1).Values = rngUV .Chart.SeriesCollection(2).Values = rngImp End With 'copy/paste as values With ActiveWorkbook.Sheets("Dashboard").Cells .Copy .PasteSpecial Paste:=xlPasteValues End With With ActiveWorkbook.Sheets("Demographics").Cells .Copy .PasteSpecial Paste:=xlPasteValues End With With ActiveWorkbook.Sheets("Flighting").Cells .Copy .PasteSpecial Paste:=xlPasteValues End With Application.CutCopyMode = False 'copy to new workbook Dim oldwb As Workbook Dim newwb As Workbook Set oldwb = ActiveWorkbook oldwb.Sheets("Flighting").Copy Set newwb = ActiveWorkbook oldwb.Sheets("Demographics").Copy Before:=newwb.Sheets(1) oldwb.Sheets("Dashboard").Copy Before:=newwb.Sheets(2) 'apply theme to new workbook newwb.ApplyTheme ("c:\data_dump\MY Theme.thmx") Application.ScreenUpdating = True End Sub
http://www.excelforum.com/excel-prog...-new-book.html
Last edited by pip56789; 10-27-2010 at 01:48 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks