Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issues copying sheet with a chart

Status
Not open for further replies.

kray4660

MIS
Apr 7, 2008
1,054
0
0
US
I have inherited an Excel spreadsheet. In one section of the code it copies a sheet to a new sheet (sheets(sheets.count).copy after:= sheets(sheets.count) ) which appears to work except there is a chart on original sheet and it appears that it is not getting copied because a few lines later there is a line ActiveSheet.ChartObjects(1).Activate and I get a Application-defined or object-define error. There is a sheet activate just before this line, thus I would think it is on the proper sheet. The strange part is that when the spreadsheet was on Windows XP and Office 2003 it worked fine. Now that it is on Windows 7 and Office 2007 it fails. Any suggestions would be appreciated.
 
Hi,

Well, we could postulate and hypothesize, but actual code would eliminate all that uncertainty, if you please.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks for answering, but I figured it out. The spreadsheet in question had a blank sheet added to it (by who, I do not know). But the code was copying the blank sheet, not a sheet with a chart on it. Once I removed the blank sheet, the macro appears to be working correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top