+ Reply to Thread
Results 1 to 1 of 1

Thread: ApplyTheme error

  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    6

    ApplyTheme error

    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"

    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
    here's the entire story, it was suggested that I start a separate thread.
    http://www.excelforum.com/excel-prog...-new-book.html
    Last edited by pip56789; 10-27-2010 at 01:48 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0