Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-22-2014, 04:08 AM
pocerus pocerus is offline Excel 2010 Chart SetSourceData 1004 error Windows 7 64bit Excel 2010 Chart SetSourceData 1004 error Office 2010 32bit
Novice
Excel 2010 Chart SetSourceData 1004 error
 
Join Date: Oct 2014
Posts: 2
pocerus is on a distinguished road
Question Excel 2010 Chart SetSourceData 1004 error

Hello,

I have a problem with an Excel application that was written in my company using Office 2003. It has always worked properly in Office 2003 but when I run it in Office 2010 I get an error message after executing the SetSourceData to apply a Range taken from a group of cells in the WorkSheet.

The error message is the following: Run-time error '1004':

Method 'SetSourceData' of object'_Chart' failed.

I have tested the following code in an Excel file in Office 2010 and 2003 and the error only comes up in Office 2010.

Sub callSetSourceData()
Dim range As Range
Dim chartt As ChartObject
Set chartt = ActiveSheet.ChartObjects("Chart 1")

On Error GoTo DelSeries:
For i = 0 To 10000
chart.Chart.SetSourceData Source:=ActiveSheet.Range("A1:FA6")
Next i


Exit Sub

DelSeries:
For Each series In chart.Chart.SeriesCollection
series.Delete
Next series
Resume Next
End Sub

Any ideas on how to solve this problem or why the behaviour of VBA/Chart has changed from one Office version to another?

Many thanks for your help
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 02:41 AM.


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