+ Reply to Thread
Results 1 to 3 of 3

excel ADODB.connection to itself ? how?

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    2

    excel ADODB.connection to itself ? how?

    Hi,

    I am new to vba programming in excel and I saw this forum that seems to have good member information. Maybe some of you can help me with this.
    I created a VBA button in Excel that creates a Word-document (report) based on data in this same excel file. I used the ADODB connection to run query's on the manual filled in user data and excel tables in order to get the report data. It is like this:


    Please Login or Register  to view this content.

    If the excel file is not opened as read-only and I get the ADODB connection to itself, it will detect the manual data the user has made, even if the user did not save the excel file first. Then the report works fine.

    But if the user opens it as a read-only file and presses the 'create report' button, the ADODB connection will not detect the changes (manual user data) the user has made and it will just 'open' the document as it was during the last save.
    So actually I need something like

    Please Login or Register  to view this content.
    Do you see what i mean? Is there any way to get this? To refer to the actual opened read-only document? Or any other solution?

    Best Regards,

    Joris

  2. #2
    Registered User
    Join Date
    07-26-2010
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: excel ADODB.connection to itself ? how?

    I solved the problem by first saving the file if it was read-only.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel ADODB.connection to itself ? how?

    FYI, due to memory leaks, it is not a good idea generally to use ADO to query an open workbook. You should be fine if it's only a couple of queries, but otherwise it's best avoided.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1