Trapping Excel messages

  • Thread starter Thread starter ramakishna rao
  • Start date Start date
R

ramakishna rao

Hi



We have a requirement like explained below.

If user selects a file through his application (using a dialog box )
and that file is already opened by someone windows gives a message as
shown below.



File is being modified by someone. Open as Read only ?



We want to trap that message before windows .Our application is
developed in VB

The file will be undergoing updation.



My objective is to prevent windows from raising this question.

I want to give a message to the user ‘Please close the file which is
opened before ‘



User has to close the file and then select the file through the program
and proceed.



If any one knows solution to this , kindly mail to my id.

Thanks

Rk

We have another requirement

My VB program is processing (updating )an excel file . While it is
being processed if user opens another excel file (not blank excel
file), the one being processed also opens and if user closes that file
, porgram gives run time error. How to prevent file being processed
from opening when user opens another excel file. ?
thanks
rk
 
Hi



We have a requirement like explained below.

If user selects a file through his application (using a dialog box )
and that file is already opened by someone windows gives a message as
shown below.



File is being modified by someone. Open as Read only ?



We want to trap that message before windows .Our application is
developed in VB

The file will be undergoing updation.



My objective is to prevent windows from raising this question.

I want to give a message to the user ‘Please close the file which is
opened before ‘



User has to close the file and then select the file through the program
and proceed.



If any one knows solution to this , kindly mail to my id.

Thanks

Rk

We have another requirement

My VB program is processing (updating )an excel file . While it is
being processed if user opens another excel file (not blank excel
file), the one being processed also opens and if user closes that file
, porgram gives run time error. How to prevent file being processed
from opening when user opens another excel file. ?
thanks
rk

First problem:

Very rough:
application.displayalerts=false

Perhaps with an "On Error Resume Next" statement and checking the
Err-value.

Second problem:
Perhaps you can hide the processed-file?

Worksbooks("Workbookname").activate
ActiveWindow.Visible = False

CoRrRan
 
MS has code here that checks to see if any file is open:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q138621
XL: Macro Code to Check Whether a File Is Already Open (Q138621)

And it's even called "IsFileOpen"!!!


Maybe you can modify your VB program so that it opens its own instance of
excel. Then after you've thoroughly debugged it, you could make so that
instance never gets visible. (If it's hidden from the user, they can't screw it
up.)
 
Back
Top