The following code runs fine once, then when
I step through a second time it doesn't select the sheet, chart, or
printout the chart until I do a Reset from the Run menu in the VBA
window. I'm sure its easy as I'm trying to learn this on the fly.
Any help is appreciated.
Bob
Private Sub PrintInboundAbbamonte_Click()
On Error GoTo Err_PrintInboundAbbamonte_Click
Dim App As Object
Set App = CreateObject("Excel.Application")
App.Visible = True
'Only XL 97 supports UserControl Property
On Error Resume Next
App.UserControl = True
App.Workbooks.Open ("C:\Documents and
Settings\RPhelps.NGC\Desktop\Inbound1.xls")
ActiveWindow.Visible = True
Windows("Inbound1.xls").Activate
Sheets("Steve Abbamonte").Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.PrintOut Copies:=1, Collate:=True
Windows("Inbound1.xls").Close
App.Quit
Exit_PrintInboundAbbamonte_Click:
Exit Sub
Err_PrintInboundAbbamonte_Click:
MsgBox Err.Description
Resume Exit_PrintInboundAbbamonte_Click
End Sub