I get the following message
I am using this code, below and it works a treat. My only problem
is that after every thing has finished printing I get the Excel message box asking do I want to save the Excel file, Yes/No.
Have you any idea how to stop Excel asking thais question?,I do not want the user to have to do this everytime they print.
Private Sub cmdClick_Click()
On Error Resume Next
Set objExcel = GetObject(",Excel.Application")
If Err.Number <> 0 Then
Set objExcel = CreateObject("Excel.Application")
End If
Err.Clear
On Error GoTo 0
objExcel.Visible = False
'objExcel.Workbooks.Open filename:="C:\Psp\define.xls"
'objExcel.Visible = True
'objExcel.WindowState = xlNormal
objExcel.Workbooks.Open filename:="C:\Psp\define.xls"
objExcel.Cells(22, 8).Value = txtStan(54).Text
objExcel.Cells(1, 1).Value = txtStan(50).Text
objExcel.Cells(2, 1).Value = txtStan(52).Text
objExcel.Cells(3, 1).Value = txtStan(51).Text
objExcel.Cells(4, 1).Value = txtStan(53).Text
objExcel.Cells(5, 1).Value = txtStan(55).Text
objExcel.Cells(6, 1).Value = txtStan(56).Text
objExcel.Cells(7, 1).Value = txtStan(57).Text
objExcel.Cells(8, 1).Value = txtStan(58).Text
objExcel.ActiveWorkbook.PrintOut
objExcel.Quit
End Sub
Thanks