+ Reply to Thread
Results 1 to 2 of 2

Problem with Selection.QueryTable.Refresh BackgroundQuery:=False

  1. #1
    Registered User
    Join Date
    10-17-2007
    Posts
    1

    Problem with Selection.QueryTable.Refresh BackgroundQuery:=False

    I inherited an excel spreadsheet from a programmer who is now long gone. It uses a macro and ODBC to access some data on the AS/400. We recently merged 2 partitions on the AS/400 and the macro stopped working. I updated the ODBC configuration to point to the correct partition, but then the macro throws an error at the line

    Selection.QueryTable.Refresh BackgroundQuery:=False

    I get a Run-time error '1004' General ODBC error.

    When I comment out the 'Selection.QueryTable' line the macro runs but the user says it returns no data.

    I am flummoxed. Any help would be appreciated.

    Bryan

  2. #2
    Forum Contributor Tarball's Avatar
    Join Date
    04-21-2007
    Location
    Atlanta, GA
    Posts
    166
    Add this to the code below your connection parameters. It will print out the exact ODBC error codes encountered

    Please Login or Register  to view this content.
    Reach me at excel_help at bellsouth dot net

+ 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