Thread: File in Use
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default File in Use

How about forcing a save by putting code like this at the beginning of that
macro:

If Len(ThisWorkbook.Path) = 0 Then
MsgBox "You will need to save this file somewhere first!", _
vbExclamation, _
"running macro"
Exit Sub
End If

RBS


"Armando" wrote in message
...
Hello everyone. I have a excel file that can be downloaded from my site.
The
sheet contains a macro that runs onload and a button that calls the same
macro (if the user wants to run it again) they all run fine as long as the
user actually saves the file to his comp. If the user just says to open
the
file the onload macro runs fine once, but when the button that runs the
same
macro again is clicked the user recieves a file in use error, if they
select
to run the read only version the macro cannot be found and then the vb
stops
and you receive a error to debug or end. Is there anyway to stops this. I
really, really need some help to figure this one out as soons as possible.
Thanks in advance.