How to check if excel file is open or not using macro

How to check if excel file is open or not using macro

Post by be.. » Tue, 29 Oct 1996 04:00:00




> Anyone know how to use a macro to check if a given excel file is open or
> not. Thanks in advance.

> Junjia

You might try

        For Each wb in Workbooks
          If wb.name = "MyBook.xls" then beep
        Next


 
 
 

How to check if excel file is open or not using macro

Post by JUN.. » Wed, 30 Oct 1996 04:00:00


Anyone know how to use a macro to check if a given excel file is open or
not. Thanks in advance.

Junjia

 
 
 

1. Excel Macro: How do I check if SpreadSheet is open?

Hello again...
   I have a macro that saves the current spreadsheet as a
named, other spreadsheet e.g. "C:\Results.xls".  it's
crucial that the macro run with no prompts (it's being
called from another app).  I first do a "Kill" on the
c:\results.xls, to make sure I don't get prompted for
overwriting, but if the file happens to be open, I can't
delete the file.  Is there anyway to either
   1.  loop through the open files
or
   2.  check the contents of the "Windows" menu
to see if the file is open?

or, also, is there a way to automatically respond to, or
supress dialog box prompts?  i.e. all those prompts that say
  ... do you really want to delete the selected sheet
  ... file exists, overwrite?  
etc.

thanx a bunch!
m

2. music organizations

3. Opening an excel file while excel is open

4. Maxtor 71626ap

5. Excel VB - Check if Files are Already Open

6. Does SCSI ZIP outperform PP

7. File open my Macro Not run Excell 2007

8. Asm OP codes ?

9. connecting to an excel data file without opening the particular excel file

10. EXCEL: Macro to convert data format while opening a text file with delimiter

11. Excel 5.0 VB: Cannot open files with macro

12. opening files using macro

13. Lotus Macro quiting when using File Open command