C
CarlosAntenna
I created a workbook and saved it as a template to be used repeatedly. It
uses a query to select and extract data from an external database. The
query refreshes automatically when the workbook is opened. I recorded a
macro to save this subset of data as a database file (dBase4) and set it to
save before the workbook is closed. It works OK, but I would like make it
even better. How can I supress the two questions that pop up?
"Do you want to replace the existing file?" (yes).
"Do you want to save changes to ups.dbf?" (no).
Here is the macro:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ChDir "S:\"
ActiveWorkbook.SaveAs Filename:="S:\ups.dbf", FileFormat:=xlDBF4, _
CreateBackup:=False
End Sub
uses a query to select and extract data from an external database. The
query refreshes automatically when the workbook is opened. I recorded a
macro to save this subset of data as a database file (dBase4) and set it to
save before the workbook is closed. It works OK, but I would like make it
even better. How can I supress the two questions that pop up?
"Do you want to replace the existing file?" (yes).
"Do you want to save changes to ups.dbf?" (no).
Here is the macro:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ChDir "S:\"
ActiveWorkbook.SaveAs Filename:="S:\ups.dbf", FileFormat:=xlDBF4, _
CreateBackup:=False
End Sub