Saving using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

I know how to save a spreadsheet using VBA, but I want to move/copy the file
after it has been saved, is this possible?

I am creating a system where spreadsheets get dropped into an Inbox folder
(e.g. c:\Inbox) folder and then moved or copied to an Outbox folder (e.g.
c:\Outbox), once they have been edited and saved.

I wish to attached some code to a button that saves the spreadsheet and then
prompts the user (with a dialogue box), asking if they want to move or copy
the folder to the outbox, and then close the file down.

I understand that the move may not be possible, as the file is stil open,
but the copy (save as) will be possible.

Any help would be much appreciated.

Also, is it possible to save MS word files through excel VBA code??

Thanks in Advance.

Pinda.
 
Pinda,

You have a number of options.

Personally, I would ask the question before saving and than take the action.
So if they say, Copy, you can do a SaveAs. If they say move, you can do a
Save and a Name, or a Saveas and a Kill on the file in c:\Inbox.

As to saving a word doc, not directly, as Excel saves Excel and various text
formats. Why would you open a word doc in Excel anyway. If you must process
a Word doc from Excel VBA the 'normal' way is to use automation, which means
running an instance of Word from within your Excel VBA, and use that
instance to manipulate the Word file.
--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Bob,

Thanks for that, the save as and kill option sounds good. but will the kill
function work if the file is still open or does it execute when file is
closed?

How would I code something like that, including a dialogue box? My VBA
skills are only basic.

Thanks for your help.

Pinda.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top