Run time error 1004, General ODBC error

G

giermann

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top