Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save to Excel file without confirming new save file name

Status
Not open for further replies.

davyre

Programmer
Oct 3, 2012
197
AU
Hi, I have a piece of code here
Code:
objBook.SaveAs (strSaveFileName)

where strSaveFileName value changes everytime it goes to the loop (i.e the strSaveFileName : A, B, C, D, etc.)
The book name is already correct, so what I want to omit is the dialog box to save the file name everytime the Access creates
a new workbook. How can I skip the dialog box, so that when I run the code, it will automatically creates multiple Excel files named A, B, C, D, etc without me clicking the Save button all the time? Ask me if you need more info about the code. Thanks!
 
Ok, I got the problem, because I used
Code:
strFilter = ahtAddFilterItem(myStrFilter, "Excel Files (*.xlsx)", "*.xlsx")
strSaveFileName = ahtCommonFileOpenSave( _
                            OpenFile:=False, _
                            Filename:=rst!Vendor, _
                            filter:=strFilter, _
                            Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
apparently piece of code brings up the saveas dialog box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top