Results 1 to 3 of 3

Thread: problem with connecting to database from a different excel file

  1. #1

    Exclamation problem with connecting to database from a different excel file



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi
    I try this code with some modification and it works as a charm ... (http://www.excelguru.ca/node/18)
    BUT ...
    if i trying put my macro in the PERSONAL.XLSB (to be available for all excel docs) then it throughs an error of

    " Compile error : user defined type not defined " .
    it happens immediately after going into the subroutine (in the 1st row : Dim cnt As New ADODB.Connection, _ ..... )
    im not sure but i guess i need to export the db connection to all the worksheets (like the PERSONAL.XLSB does for VBA code ) am i right ?

    really get confused from that

    Thanks anyway, and great example - well explained !

  2. #2
    Hi chenchuk...

    have you set a reference to the ADO Libraries?

    VBA Editor -> Menu 'Tools' -> References, then check 'Microsoft ActiveX Data Objects Library'.
    Then, the compiler should find the objects.

    Regards :-)

  3. #3

    connection to MySQL

    Hi
    it works !!!
    Thanks 4 all ...

Tags for this Thread

Posting Permissions

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