J
JAG777
I'm having trouble with changing the source data of an (Excel) graph within
word.
I get error '1004' and the message is saying the Cells method of the Global
object has failed.
There are no logical errors, as the rest of the code returns the correct
information (i.e. there are 12 valid cell rows). I also have no issue
accessing the workbook - as this is shown to be updated after the sub has
finished in word - it just seems to be with the Cells method that I have the
issue??
This is the part of the code that execution stops on (wksSheet has been
declared as an Excel.Worksheet variable, intValueColumn & intValueColumn are
integers):
wksSheet.ChartObjects(1).SeriesCollection(1).Values = wksSheet.Range _
(Cells(2, intValueColumn), Cells(2, intValueColumn + 11))
wksSheet.ChartObjects(1).SeriesCollection(1).XValues = wksSheet.Range _
(Cells(1, intMonthColumn), Cells(1, intMonthColumn + 11))
I know it's something to do with automation as this chunk of code works fine
when executed within Excel? I have the Excel object library 11.00 reference
active.
Any help would be gratefully received ;-)
word.
I get error '1004' and the message is saying the Cells method of the Global
object has failed.
There are no logical errors, as the rest of the code returns the correct
information (i.e. there are 12 valid cell rows). I also have no issue
accessing the workbook - as this is shown to be updated after the sub has
finished in word - it just seems to be with the Cells method that I have the
issue??
This is the part of the code that execution stops on (wksSheet has been
declared as an Excel.Worksheet variable, intValueColumn & intValueColumn are
integers):
wksSheet.ChartObjects(1).SeriesCollection(1).Values = wksSheet.Range _
(Cells(2, intValueColumn), Cells(2, intValueColumn + 11))
wksSheet.ChartObjects(1).SeriesCollection(1).XValues = wksSheet.Range _
(Cells(1, intMonthColumn), Cells(1, intMonthColumn + 11))
I know it's something to do with automation as this chunk of code works fine
when executed within Excel? I have the Excel object library 11.00 reference
active.
Any help would be gratefully received ;-)