ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check if file already is open (https://www.excelbanter.com/excel-programming/339585-check-if-file-already-open.html)

Mats Nilsson

check if file already is open
 
Hi all,
In a vba routine a specific workbook has to be opened, but if it´s already
open (by another user) it shouldn´t be opened as read-only. Instead i will
interrupt the routine and give a msg "the file is already opened by another
user, the routine is interrupted". I cant find a method to check if the file
is open.
I have a similar question when updating PowerPoint slides from Excel. In
that case I will check if a specific power-point is opened.
Thanks in advance
Regards
Mats
ESI Update

Tom Ogilvy

check if file already is open
 

http://support.microsoft.com?kbid=138621
XL: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=291295
XL2002: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=213383
XL2000: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=184982
WD97: VBA Function to Check If File or Document Is Open


--
Regards,
Tom Ogilvy

"Mats Nilsson" wrote in message
...
Hi all,
In a vba routine a specific workbook has to be opened, but if it´s already
open (by another user) it shouldn´t be opened as read-only. Instead i will
interrupt the routine and give a msg "the file is already opened by

another
user, the routine is interrupted". I cant find a method to check if the

file
is open.
I have a similar question when updating PowerPoint slides from Excel. In
that case I will check if a specific power-point is opened.
Thanks in advance
Regards
Mats
ESI Update




Mats Nilsson

check if file already is open
 
Hi Tom,
Thanks for your help. It seems to work in my routines.
Regards,
Mats
--
ESI Update


"Tom Ogilvy" wrote:


http://support.microsoft.com?kbid=138621
XL: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=291295
XL2002: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=213383
XL2000: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=184982
WD97: VBA Function to Check If File or Document Is Open


--
Regards,
Tom Ogilvy

"Mats Nilsson" wrote in message
...
Hi all,
In a vba routine a specific workbook has to be opened, but if it´s already
open (by another user) it shouldn´t be opened as read-only. Instead i will
interrupt the routine and give a msg "the file is already opened by

another
user, the routine is interrupted". I cant find a method to check if the

file
is open.
I have a similar question when updating PowerPoint slides from Excel. In
that case I will check if a specific power-point is opened.
Thanks in advance
Regards
Mats
ESI Update






All times are GMT +1. The time now is 05:46 PM.

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