ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel File Open and Locking Issue (https://www.excelbanter.com/excel-programming/399581-excel-file-open-locking-issue.html)

Ronald Dodge[_2_]

Excel File Open and Locking Issue
 
Is there an easy way to test to see if a particular Excel file is currently
open and locked via VBA without trying to open the file?

I would like to test this prior to VBA using the TransferSpreadsheet method
in Access. If the file is open, the code will be stuck on
"TransferSpreadsheet" line until the file is closed out, which then the code
will error out. Therefore, if the file is open and locked, I would like VBA
to pick up on this, display an error message with the fact the file is open
and locked, and by whom. If need be, this can be going through Windows API.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000




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

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