Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-23-2014, 01:51 PM
whatsup whatsup is offline Excel 2010 Chart SetSourceData 1004 error Windows 7 64bit Excel 2010 Chart SetSourceData 1004 error Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Hi

Sure enough your posted code "as is" won't even work under excel 2003, that's because:
chart.Chart.SetSourceData Source:=ActiveSheet.Range("A1:FA6")
has to be:
chartt.Chart.SetSourceData Source:=ActiveSheet.Range("A1:FA6")

Otherwise you walk on thin ice: You're using the chart's name given by excel. Excel itself names chart according to the number of charts within a Sheet, for the first chart the name will be "Chart 1". Now regardless if the first chart still exists, the next chart created will be called "Chart 2". - and so on...
So just check the name of the chart to be modified, if it's indeed "Chart 1" if not so you will have to rename the chart, or correct your code.

See if the error renames, in case tell me which line of the code is marked by the debugger. But maybe above already helped!
Reply With Quote
 

Tags
seriescollection, setsourcedata, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error '1004' galkej Excel 0 02-03-2014 06:39 AM
Excel 2010 Chart SetSourceData 1004 error Run-time error '1004': Document not saved. The document may be open... doctor_who12 Excel Programming 1 01-22-2014 04:47 PM
paste fails error 1004 in VBA Excel 2010 mikec Excel Programming 17 05-08-2013 03:11 PM
Excel 2010 Chart SetSourceData 1004 error Run time error 1004 yonasan Excel Programming 3 06-12-2012 11:08 PM
Excel 2010 Chart SetSourceData 1004 error runtime error 1004 gbaker Excel Programming 11 06-06-2012 05:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft