Home > Forum Home > Automating Data Analysis Tasks > Send variables to MSQuery via entry in Excel cell range? | Share |
Forum Topic | Post Reply Login |
Send Variables To Msquery Via Entry In Excel Cell Range? | Rate this: (3/5 from 1 vote) |
I do a lot of data query with Excel, and am running into projects where it is impractical to continue because of query variables that change. Currently this requires that I open the query, manually chance the variable/criteria, refresh, return to Excel, print, then start over again! Specifically I'm pulling information for sales usage by a specific salesperson and date range. If there are 40 salespersons, this requires editing the MSQuery 40 times to get the data! What I'd like to do is build the Excel report to include an input cell or two (today's date (via formula) and sales ID), have that data pass directly to MSQuery and return the updated data - without having to open MSQuery. Possible? Thanks! | ||
Posted by jwhitwell on |
Replies - Displaying 11 to 12 of 12 | Order Replies By: Most Recent | Chronological | Highest Rated |
Rate this: (3/5 from 1 vote) I tried running the code above with just the database definitions changed and i keep getting a 438 error : OBject doesnt support this property or method. I assume this means i'm using a method in a way i shouldn't, as i said i only changed the database definition. I have never used VB before i just had to use it with excel it seems to be the line With ActiveSheet.QueryTables.Add(Connection:=Array("ODBC;DSN=**************;Description=*****************;APP=Microsoft Office XP;DATABASE=*****************;Trusted_Connection=YES"), Destination:=Range("B5").CommandText = Array("SELECT * FROM *****.****.*************, ********.************ WHERE **************='val'")) The *** are obviously datatbase stuff i cant post on the net. Other than that it seems to be the same, any ideas?? | |
Posted by tweedledum on |
Rate this: (2.6/5 from 5 votes)
VBA Code: (vARIABLE CRITERIA GIVES COMPILE ERROR: Expected: list seperator or )
Hi All, Using the code posted in this thread a few years ago I made some changes to my VBA code. My purpose was to change the fixed criteria Macro to a variable criteria that is a Cell reference in excel sheet. However when I do that i get Compiling error: Expected: list seperator or ) I get the error where I have typed the variable criteria formula { &" ) AND (GLACC_PER.PERIOD_NO<=" } I am not good with VBA if you can help it would be appreciated. Thanks heaps- [email protected] | |||
Fraz- [email protected] | |||
Posted by frazrana on |
Back | Displaying page 2 of 2 |
Find relevant Excel templates and add-ins for Send variables to MSQuery via entry in Excel cell range? in the Excel Business Solutions Directory |