ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xlBook.SaveAs (documentName) when file open by another process (https://www.excelbanter.com/excel-programming/379417-xlbook-saveas-documentname-when-file-open-another-process.html)

[email protected]

xlBook.SaveAs (documentName) when file open by another process
 
When I attempt to use the line -
xlBook.SaveAs (documentName)
to save an excek document I have created (or edited), I get an error
when this document is open by another process. I'm creating this excel
doc within visio and the problem will occur if the client already has
this file open with excel. How might I handle this situation?

Thanks for your help,

Barry.


[email protected]

xlBook.SaveAs (documentName) when file open by another process
 

skrev:

When I attempt to use the line -
xlBook.SaveAs (documentName)
to save an excek document I have created (or edited), I get an error
when this document is open by another process. I'm creating this excel
doc within visio and the problem will occur if the client already has
this file open with excel. How might I handle this situation?

Thanks for your help,

Barry.


Here what I'm doing now.

On Error Resume Next
xlBook.SaveAs (documentName)
On Error GoTo 0

Does it seems ok?


NickHK

xlBook.SaveAs (documentName) when file open by another process
 
Barry,
Remove the (..) from your statement. You are not using the return value
(well there is not one as its a sub), so you do not they are not used

NickHK

wrote in message
oups.com...
When I attempt to use the line -
xlBook.SaveAs (documentName)
to save an excek document I have created (or edited), I get an error
when this document is open by another process. I'm creating this excel
doc within visio and the problem will occur if the client already has
this file open with excel. How might I handle this situation?

Thanks for your help,

Barry.





All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com