Here is the code I have:
Public Function openexcel()
Dim xl As Excel.Application
Dim sheet2 As Object
Dim workbook As Object
Set xl = CreateObject("excel.Application")
xl.Workbooks.Open ("C:\last eight periods chart.xls") ' substitute your file here
xl.Visible = True
xl.DisplayAlerts = False
xl.ActiveWorkbook.RefreshAll
Set sheet2 = xl.ActiveWorkbook.Sheets("chart1")
sheet2.printout , , , , , , , "c:\chart.pdf"
It keeps wanting to open the acrobat viewer once the chart has been printed? Is there a way to stop this from happening? Thanks
Public Function openexcel()
Dim xl As Excel.Application
Dim sheet2 As Object
Dim workbook As Object
Set xl = CreateObject("excel.Application")
xl.Workbooks.Open ("C:\last eight periods chart.xls") ' substitute your file here
xl.Visible = True
xl.DisplayAlerts = False
xl.ActiveWorkbook.RefreshAll
Set sheet2 = xl.ActiveWorkbook.Sheets("chart1")
sheet2.printout , , , , , , , "c:\chart.pdf"
It keeps wanting to open the acrobat viewer once the chart has been printed? Is there a way to stop this from happening? Thanks