[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

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

Barry

12/14/2006 2:32:00 PM

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.

2 Answers

Barry

12/15/2006 8:57:00 AM

0


bg_ie@yahoo.com 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

12/15/2006 9:27:00 AM

0

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

<bg_ie@yahoo.com> wrote in message
news:1166106717.371413.108520@t46g2000cwa.googlegroups.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.
>