How do I connect to an open Excel file?

Results 1 to 3 of 3

Thread: How do I connect to an open Excel file?

  1. #1
    Vincent Poortinga Guest

    Default How do I connect to an open Excel file?

    I&#039;m using an Excel file we have in our office as an OLE DB. It is located on a shared drive, and is regularly opened and edited. I&#039;m simply using it to report some of its information through ASP.<BR><BR>Everything seems to work fine when the file is closed, but when it is open and I try to connect to it, I get the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Excel Driver] Cannot open database &#039;(unknown)&#039;. It may not be a database that your application recognizes, or the file may be corrupt. <BR><BR>Here&#039;s my connection string, which works when the file is closed:<BR>"Driver={Microsoft Excel Driver (*.xls)};" & _<BR> "DriverId=790;" & _<BR> "Dbq=J:shareaatproj.xls;" & _<BR> "DefaultDir=J:share;" <BR><BR>So, can I connect to an open Excel file, and if so, how?<BR><BR>Thanks,<BR>Vincent Poortinga

  2. #2
    Join Date
    Dec 1969

    Default You can't

    Yes I don&#039;t believe you can even connect Access on your desktop to an OPEN Excel file. And if someone is the 2nd person to open an Excel file (correct me if I&#039;m wrong but) I believe that they can only open the file on a read-only basis or save it with a different filename...<BR><BR>Best regards,<BR>-Paul<BR><BR> - Web Database Developer<BR><BR>Bullschmidt Bar Chart - Free ASP Bar Chart Tool<BR><BR><BR><BR>

  3. #3
    Vincent Poortinga Guest

    Default You're correct, but...

    If a second person opens the excel file, it is in read-only mode. So I&#039;m wondering if ADO can connect similarly in a read-only mode. I tried using adLockReadOnly, but that didn&#039;t work either. Is there another way?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts