Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with error 1004 in database query
I am writing a block of Visual Basic code for use with
Excel: With ActiveSheet.QueryTables.Add (Connection:=connectionString, _ Destination:=Range("A1")) .CommandText = SQLText .Name = DataSourceName & "Query" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = False .RefreshStyle = xlInsertDeleteCells .SavePassword = True .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With However, at the statement ".Refresh BackgroundQuery:=False", I got a run-time error 1004: Application-defined or object- defined error. The strange thing is that the same query worked well for a few days before ... Does anyone know what is the cause of the problem? How I can solve this problem? Please help! Thank you very much. Alex. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import New Database Query (Union Query) in Spreadsheet | Excel Discussion (Misc queries) | |||
odbc error on Excel query into database | Excel Discussion (Misc queries) | |||
database query not showing foxpro database How I import data | New Users to Excel | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) |