dougmarkham
Active Member
- Joined
- Jul 19, 2016
- Messages
- 252
- Office Version
- 365
- Platform
- Windows
Hi Folks,
I have a VBA model (*.xltx in draft stage) in which I import a specific excel file (containing multiple ws) from a specific file path. I am modifying some of the data. Once modified, I want to SaveAs to overwrite the file I originally imported. The file I'm importing will be called something new each time the model is run (on account of it being an export that contains a time-stamp) but the filePath will only ever contain one file.
I have come across various methods of using VBA to open a dialog box to a specified filePath preset to save as *.xlsx. All of them seem to require you to provide a file name in advance.
Does anybody know of VBA code to overwrite an existing excel file stored within a specific filePath?
i.e., for VBA to look for the excel file located within a specified file path; take file name; place file name into the "File name: " box in the SaveAs dialogue box---so the user can press save?
Kind regards,
Doug.
I have a VBA model (*.xltx in draft stage) in which I import a specific excel file (containing multiple ws) from a specific file path. I am modifying some of the data. Once modified, I want to SaveAs to overwrite the file I originally imported. The file I'm importing will be called something new each time the model is run (on account of it being an export that contains a time-stamp) but the filePath will only ever contain one file.
I have come across various methods of using VBA to open a dialog box to a specified filePath preset to save as *.xlsx. All of them seem to require you to provide a file name in advance.
Does anybody know of VBA code to overwrite an existing excel file stored within a specific filePath?
i.e., for VBA to look for the excel file located within a specified file path; take file name; place file name into the "File name: " box in the SaveAs dialogue box---so the user can press save?
Kind regards,
Doug.