Trouble with charts in Excel 2007 - Access 2007/VBA

  • Thread starter ragtopcaddy via OfficeKB.com
  • Start date
R

ragtopcaddy via OfficeKB.com

I have the following line of code in an Access module:

Set xlChartObject = XLobj.ActiveSheet.ChartObjects(i + y)

I get error 1004, "Application defined, or object defined error".

This code worked fine in 2003, but refuses to budge in 2007.

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-programming/200810/1
 
R

ragtopcaddy via OfficeKB.com

I discovered why this line doesn't work. There are no additional charts in
the worksheet! The problem actually lies with the following code, which
worked in 2003:

If i < nCount Then 'There is at least one more store to be
reported
.Range(.Cells(N - (conRows - 1), 1), .Cells(N, conCols)).
Select
XLobj.Selection.Copy
.Range(.Cells(N + 1, 1), .Cells(N + conRows, conCols)).Select
XLobj.Selection.Insert
XLobj.CutCopyMode = False
XLobj.ActiveWindow.SelectedSheets.HPageBreaks.Add Before:
=XLobj.ActiveCell
XLobj.ActiveCell.Offset(-conRows, 0).Activate
Else
'use the last blank form for the last store
.Range(.Cells(N - (conRows - 1), 1).Address).Activate
End If

The copy/paste procedure above is no longer including the 10 charts that
exist in the range selected in the worksheet.
I have the following line of code in an Access module:

Set xlChartObject = XLobj.ActiveSheet.ChartObjects(i + y)

I get error 1004, "Application defined, or object defined error".

This code worked fine in 2003, but refuses to budge in 2007.

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-programming/200810/1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top