Confirm SaveAs takes place.

S

SJW_OST

I have a file that automatically copies out specific tabs of my main workbook
to a new workbook and then I am using the following code to save the new
workbook to a intranet sharepoint with a name_date_time format for the file
name.

ActiveWorkbook.SaveAs "http://path/" & "PassCounts_" &
format(now,"mmddyy_hhmmss") & ".xls"

How can I have Excel verify the SaveAs function took place on the new
workbook, saving the file appropriately to the intranet sharepoint, with out
a prompt to accept or cancel? If the SaveAs function did not take place,
acctually saving the file, I want the SaveAs process to loop until it does
take place.

Any help is appreciated.
Stephen W
 
J

Jim Thomlinson

if the workbook was saved then the saved property will be true.

do
ActiveWorkbook.SaveAs "http://path/" & "PassCounts_" &
format(now,"mmddyy_hhmmss") & ".xls"

loop until activeworkbook.saved = true
 
J

John Keith

I have a file that automatically copies out specific tabs of my main workbook
to a new workbook

Teach me how to save specific tabs. I think I might need this soon.

Thanks

PS - the response to your OP was useful also. This is a great group!



John Keith
(e-mail address removed)
 
R

Ron de Bruin

Oops(I press the send button to fast)

If you want to save a few sheets to a new workbook you can use this to copy them to a new workbook

Sheets(Array("Sheet1", "Sheet3")).Copy
 
S

SJW_OST

This works great, thank you!

Jim Thomlinson said:
if the workbook was saved then the saved property will be true.

do
ActiveWorkbook.SaveAs "http://path/" & "PassCounts_" &
format(now,"mmddyy_hhmmss") & ".xls"

loop until activeworkbook.saved = true
 
J

John Keith

Oops(I press the send button to fast)

If you want to save a few sheets to a new workbook you can use this to copy them to a new workbook

Sheets(Array("Sheet1", "Sheet3")).Copy

Thank you Ron, I think that will work great.



John Keith
(e-mail address removed)
 

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

Top