G
Guest
When I run the following code, I get message boxes that
pop up that ask if I want to save the files. Since I am
actually saving these files already, the message box seems
a little redundant. Is there anyway to write code to
automatically answer these as no or is there a way to keep
them from popping up at all?
Sub DataImport()
Dim App As Object
Set App = CreateObject("Excel.Application")
App.Visible = False
App.UserControl = False
Dim Book1 As Object
Set Book1 = App.Workbooks.Open("C:\Import
Data\exceldr.dat")
Book1.SaveAs ("C:\Import Data\exceldr.xls")
Book1.Close
Dim Book2 As Object
Set Book2 = App.Workbooks.Open("C:\Import
Data\excelwr.dat")
Book2.SaveAs ("C:\Import Data\excelwr.xls")
Book2.Close
Dim Book3 As Object
Set Book3 = App.Workbooks.Open("C:\Import
Data\safereq.dat")
Book3.SaveAs ("C:\Import Data\safereq.xls")
Book3.Close
Set Book1 = Nothing
Set Book2 = Nothing
Set Book2 = Nothing
App.Quit
Set App = Nothing
pop up that ask if I want to save the files. Since I am
actually saving these files already, the message box seems
a little redundant. Is there anyway to write code to
automatically answer these as no or is there a way to keep
them from popping up at all?
Sub DataImport()
Dim App As Object
Set App = CreateObject("Excel.Application")
App.Visible = False
App.UserControl = False
Dim Book1 As Object
Set Book1 = App.Workbooks.Open("C:\Import
Data\exceldr.dat")
Book1.SaveAs ("C:\Import Data\exceldr.xls")
Book1.Close
Dim Book2 As Object
Set Book2 = App.Workbooks.Open("C:\Import
Data\excelwr.dat")
Book2.SaveAs ("C:\Import Data\excelwr.xls")
Book2.Close
Dim Book3 As Object
Set Book3 = App.Workbooks.Open("C:\Import
Data\safereq.dat")
Book3.SaveAs ("C:\Import Data\safereq.xls")
Book3.Close
Set Book1 = Nothing
Set Book2 = Nothing
Set Book2 = Nothing
App.Quit
Set App = Nothing