commandtext

  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

This Week's Hot Topics

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top