R
ryan.fitzpatrick3
I get a type mismatch error on this. I have one book that is on
windows scheduler, when it opens (on the scheduled time) it auto runs
the macro's in another workbook. It works perfectly except I want it
to close all workbooks without prompting me "do you want to save". How
can I do this without getting a type mismatch error?
Sub Autpen()
'The following code provides a general outline to do what you
describe.
Workbooks.Open Filename:= _
"C:\Documents and Settings\rfitz03\Desktop\RYAN'S EXCEL SHEETS
\Strategic Sourcing\Forms\Position Sheet\Flour Position Sheet
2008-1.xls"
Application.Run "'Flour Position Sheet 2008-1.xls'!Access_Data"
Application.Run "'Flour Position Sheet 2008-1.xls'!
Mail_Plant_Info_Range_without_prompt"
Application.DisplayAlerts = False
Workbooks("Automation.xls").Close
Workbooks("Flour Position Sheet 2008-1.xls").Close
Application.DisplayAlerts = True
ThisWorkbook.Saved = True
Application.Quit
End Sub
windows scheduler, when it opens (on the scheduled time) it auto runs
the macro's in another workbook. It works perfectly except I want it
to close all workbooks without prompting me "do you want to save". How
can I do this without getting a type mismatch error?
Sub Autpen()
'The following code provides a general outline to do what you
describe.
Workbooks.Open Filename:= _
"C:\Documents and Settings\rfitz03\Desktop\RYAN'S EXCEL SHEETS
\Strategic Sourcing\Forms\Position Sheet\Flour Position Sheet
2008-1.xls"
Application.Run "'Flour Position Sheet 2008-1.xls'!Access_Data"
Application.Run "'Flour Position Sheet 2008-1.xls'!
Mail_Plant_Info_Range_without_prompt"
Application.DisplayAlerts = False
Workbooks("Automation.xls").Close
Workbooks("Flour Position Sheet 2008-1.xls").Close
Application.DisplayAlerts = True
ThisWorkbook.Saved = True
Application.Quit
End Sub