Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Everyone,
I have a piece of code in Excel 2000 to retrieve some data from Access 2000 using MS Query and it works fine. The problem is that I need to copy down the formulas to the right of the data and it does not do it even tough I have the line: FillAdjacentFormulas=True on it. The funny thing is that if I do a straight "refresh" in the worksheet it copies all the formulas perfectly. The reason why I need to do it using a macro is because I need the user to select some criteria from another worksheet. (I tested this and it works too) Here's the code: With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _ "ODBC;DSN=MS Access Database;DBQ=S:\FF Files\Profit Model.mdb;DefaultDir=S:\FF Files;DriverId=25;FIL=MS Access;MaxBufferSize=" _ ), Array("2048;PageTimeout=5;")), Destination:=Range("A10")) .CommandText = Array( _ ----SQL Statement Here---- .Name = "Query from MS Access Database" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = True .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlOverwriteCells .SavePassword = True .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With Is there anything that I am missing or doing wrong? I thank you all in advance Gustavo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
QUERY & HELP: so slow executing VBA code... :S | Excel Worksheet Functions | |||
how can i query an sheet with a where clause....from c# code using | Charts and Charting in Excel | |||
Code Query | Excel Programming | |||
Query on small piece of code | Excel Programming | |||
query source code | Excel Programming |