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!

I need to Copy a Word file when the user saves a spreadsheet

Status
Not open for further replies.

noviceSoFar

Programmer
May 24, 2007
2
US
I have developed an Excel spreadsheet that generates a mail merged Word document with certain cells acting as the data for the mail merge. That works fine. The problem comes when the user wants to save the Excel file to another directory or drive. If its on the same computer, no problem as long as you can access the template Word document. But if the user saves the Excel file to, let's save a USB drive, I want the mail merge Word document to be copied at the same time and a certain cell in Excel to indicate what directory the files were last saved to. Is that possible?

Is there a way to record in a cell where the user saved to last? I can get the rest if that is possible.
 
The Excel folks will probably be able to help you. I don't know if you can intercept/rewrite the Excel SaveAs command, like you can with Word.

With Word you would simply display the SaveAs dialog, and copy the SaveAs name to something (a log file?) before completely the actual saveas. From taking a peek, you may be able to do the same with the GetFileSaveAs method, in Excel.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top