ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing Closed Files (https://www.excelbanter.com/excel-programming/281476-testing-closed-files.html)

Paul W Smith[_2_]

Testing Closed Files
 
I have a number of XL workbooks in a directory. I want to loop through
every workbook, checking if that workbook contains as wks called 'NEW' and
if it does, collect data from this worksheet. I have written code that
achieves this, but I do this by opening every WB to test if the 'NEW'
worksheet exists. This is very time consuming as every file has to be
opened and closed.

Is it possible, through code, to test for the existence of a worksheet
within a closed workbook. If it does test whether it is visible or hidden
WITHOUT opening the workbook?

Paul Smith



Dick Kusleika[_3_]

Testing Closed Files
 
Paul

I don't think that's possible. You might consider setting
Application.Calculation, Application.ScreenUpdating to False to speed up
what you already have.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Paul W Smith" wrote in message
...
I have a number of XL workbooks in a directory. I want to loop through
every workbook, checking if that workbook contains as wks called 'NEW' and
if it does, collect data from this worksheet. I have written code that
achieves this, but I do this by opening every WB to test if the 'NEW'
worksheet exists. This is very time consuming as every file has to be
opened and closed.

Is it possible, through code, to test for the existence of a worksheet
within a closed workbook. If it does test whether it is visible or hidden
WITHOUT opening the workbook?

Paul Smith






All times are GMT +1. The time now is 09:24 AM.

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