Consulting

Results 1 to 6 of 6

Thread: OleObject file Access in an Excel file

  1. #1
    VBAX Newbie
    Joined
    Jan 2012
    Posts
    3
    Location

    Smile OleObject file Access in an Excel file

    HI Everybody,
    I am working with an excel VBA application, I have an Access file inserted inside a sheet as an OLEObject file. My problem is that I would like to connect to that Access file using DAO or ADO, but I don't know how to do, because I don't know the reference to the OLEObject in order to fill the 'Data Source' field of the connection.

    Someone knows what to do?

    thanks,
    bye

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why are you embedding it, why not just connect to the .mdb?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Jan 2012
    Posts
    3
    Location
    For practice, so I will work with only one file (the excel file) and not with 2 files (.xls and .mdb); I thought that it would be easy to reference the .mdb file in order to initialize the connection with ADO.

    thanks anyway,

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Well, I have never tried, but I can imagine problems because the ADO connection string requires a source, which is usual a physical folder. working with 2 files is not a problem.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Newbie
    Joined
    Jan 2012
    Posts
    3
    Location
    I think that it 's necessary only the reference to the file, sometimes like WORKBOOK|SHEET1|OBJECT_NAME..............but I don't know.......

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Maybe you are right, but maybe you are wrong. There was certainly memory leak problems trying to access an open Excel workbook via ADO, goodness knows how it would cope with an embedded database in an open workbook.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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