Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Run time error 1004, General ODBC error

Hi-

I've seen other people ask similar questions, but haven't seen an
answer. I recorded a macro, and it has run fine dozens of times, but
all of a sudden I'm getting a "run time error 1004, general ODBC error"
message. When I go to debug, it shoes me the line:

..Refresh BackgroundQuery:=False

I don't know how to program in the macro language, I just recorded
this. I've searched all over the net for an answer, but have never
found one, other than the suggestion that perhaps the worksheet I'm
searching is too large (but no solution was proposed).

Thanks!
-Amanda




Sub Fleet()
'
' Fleet Macro
' Macro recorded 8/6/2001 by alg
'

'
Sheets("Fleet").Select
Cells.Select
Selection.ClearContents
Selection.ClearOutline
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;C:\WINDOWS\Application
Data\Microsoft\Queries\FleetSummary.dqy", Destination _
:=Range("A1"))
.Name = "FleetSummary"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
Range("A1:F1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Range("B1").Select
Selection.Subtotal GroupBy:=6, Function:=xlSum, TotalList:=Array(5,
6), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error on second pass of loop. Rob Excel Discussion (Misc queries) 1 September 9th 05 07:26 PM
time sheet Jesse_Norris Excel Discussion (Misc queries) 4 September 8th 05 04:43 AM
'Time to Fix' Formula wlln001 Excel Discussion (Misc queries) 1 September 7th 05 12:11 PM
Run time error 9 : Subscript out of range JAtz_DA_WAY Excel Discussion (Misc queries) 6 August 29th 05 08:26 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 4 November 18th 04 03:24 PM


All times are GMT +1. The time now is 07:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"