#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default ADO help

Hi, I'm using ADO to get data frm closed excel sheet. But when the file from
which I'm trying to get data is opened in some other system, then excel will
try opening that file.. is there a way to avoid this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ADO help


Not sure if this would work, but it might be worth a quick test.

You could copy the Excel file, save it with a new name and then use ADO
to read from it, then kill the copied file.

Excel lets you copy a workbook that is open and save it, so this would
make sure that the workbook you are trying to open is closed.

That's a lot of overhead to do every time you want to read from a
workbook, when most often the workbook will be closed. A search with
terms



gave a bunch of hits, with the following one looking interesting:

'Visual Basic sample code - Determine if a File is open - Source code
examples' (http://tinyurl.com/ljzbom)

although in the comments it says it will return a "not open" status if
the file has not been opened exclusively - which sounds like the way
Excel works. But, it might tell you - you'd just have to check it. And
of course, there may be other code samples on the web that can detect
files open non-exclusively; you would need to do more research...

Hope this helps - please post back on what you learn! :Bgr


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=127311

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"