1. E

    Update FROM in CommandText

    I have a spreadsheet that is used by different users. The spreadsheet defaults to the user's desktop folder when pulling from an Access database. My connections get updated appropriately with the VBA code I inherited, but it doesn't update the user's profile in the following code: Note: this is...
  2. R

    Import SQL via TXT to .CommandText

    Hello All, I have a need to import a text file that stores a SQL query that is over 1K lines of code directly into the Command Text of a ODBC data connection in Excel. I know the query works if I manually copy/paste the code directly into the command text and refresh the connection. Here is...
  3. U

    Long Query when importing data from Access

    I recorded the following code from an import and I am trying to clean it up so I can change a variable or two. The strange thing is that it throws a comma in the middle of the code. I have to assume it is because the line is too long but if that is the case, how do I get around it? The first...
  4. O

    RunTime Error 1004 Invalid Object Name when connection to SQL Server Database

    Hi, I've searched the forum and not found any posts reporting this problem. When running a QueryTable command in VBA I keep getting the error: RunTime Error 1004: Invalid object name: 'MyDatabase.Data.Amount_Source' What I cannot understand is that when I copy the SQL Query Command Text...
  5. G

    VBA CommandText "application-defined or object-defined error"

    Sub QueryUpdate() Sheets("Totals").PivotTables("PivotTable1").PivotCache.CommandText = "SELECT * FROM Totals" End SUB but it gives me the error: "application-defined or object-defined error" Any idea how I can make this work? Thanks

Some videos you may like

This Week's Hot Topics