+ Reply to Thread
Results 1 to 8 of 8

Record macro in excel, when I try to run it I get an error

  1. #1
    bugmenot
    Guest

    Record macro in excel, when I try to run it I get an error

    I am trying to change the SQL command to an odbc database connection

    Please Login or Register  to view this content.
    I recorded that in excel and then when I try to run it I get an error of:
    Application-defined or object-defined error
    When I debug it highlights this line:
    Please Login or Register  to view this content.
    Any help would be appreciated thank you.

  2. #2
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    Please Login or Register  to view this content.
    I found that from an MSDN post but do not fully understand it. I have lots of pivot tables for each connection. How would I go about doing this workaround?

    Edit: I also found
    Another forum where the guy solved the problem but I can't follow exactly

    In the second link I think the guy changed the type of connection then edited the .Commandtext field then changed type of connection back. Could anyone help me confirm this and if so what is the best way to implement it.
    Last edited by bugmenot; 07-21-2009 at 05:05 PM.

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

    Re: Record macro in excel, when I try to run it I get an error

    Quote Originally Posted by bugmenot View Post
    Edit: I also found
    Another forum where the guy solved the problem but I can't follow exactly

    In the second link I think the guy changed the type of connection then edited the .Commandtext field then changed type of connection back. Could anyone help me confirm this and if so what is the best way to implement it.
    Correct. If you look at post #8 in that thread there are two subs. The first changes all pivotcache connections from ODBC to OLEDB, the second changes them back. I don't know offhand if that will work as posted in 2007 (which I don't have to test with just now) but you could try it!
    Remember what the dormouse said
    Feed your head

  4. #4
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    While I understand the basic concept of it:
    I do not understand how I should specifically do this.

    My connection string is:
    DSN=QuickBooks Data;DFQ=I:\QB.QBW;SERVER=QODBC;OptimizerDBFolder=%UserProfile%\QODBC Driver for QuickBooks\Optimizer;OptimizerAllowDirtyReads=N;SyncFromOtherTables=N

    What I'm not sure about as I'm no VB guru is how to change their script.
    Here is what I would assume I should try to do:

    Please Login or Register  to view this content.
    I am not sure as to exactly what many of the thing in the top and bottom scripts do so it is hard to change them for my sheet. Thanks for the help, I feel like we're almost at the bottom of this!

  5. #5
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    Anyone able to help me?

  6. #6
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    Bump
    10chars

  7. #7
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    Bump
    help please!

  8. #8
    bugmenot
    Guest

    Re: Record macro in excel, when I try to run it I get an error

    bump. anyone?

+ 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