dacookmgnt
New Member
- Joined
- Feb 3, 2004
- Messages
- 14
The following code is intended to run through a list, update a graph, print it and do it over again. It goes through once, prints the graph, and then gives me a Run-Time Error '91': Object variable or With block variable not set.
Sub List()
For I = 0 To 5
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveWorkbook.Names.Add Name:="store", RefersToR1C1:=ActiveCell
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
Please help, Gurus! I'm sure you can tell I am clueless.
Thanks,
Dave
Sub List()
For I = 0 To 5
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveWorkbook.Names.Add Name:="store", RefersToR1C1:=ActiveCell
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
Please help, Gurus! I'm sure you can tell I am clueless.
Thanks,
Dave