View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] petyrc@gmail.com is offline
external usenet poster
 
Posts: 1
Default run-time error 1004

Hoping someone can help me out. I have no knowledge of VB so this is
all greek to me. Below is one of seven macro that runs to a report that
is integrated into a CRM database (salesfoece.com). I get this error
when I try to run the macro that refreshes the data being pulled from
salesforce.com into the report. I get the error message "run-time error
1004" and it highlights the following text in
yellow....Selection.QueryTable.Refresh BackgroundQuery:=False
right above this text...

' Refresh Data
Sheets("Raw Data").Select
Range("AI28").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("BH33").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("Reference").Select
Range("B26").Select

QUESTIONs:
What does "Selection.QueryTable.Refresh BackgroundQuery:=False" mean?
What does Range(BH33) mean?
How might I fix this busted macro?

thanks in advance for your help
p


COMPLETE VB SCRIPT FROM BUSTED MACRO

Sub Sort_Refresh()
'
' SOrt_Refresh Macro
' Macro recorded 11/10/2005 by tchan
'


' Clear Top 100, Raw Data sheets
Sheets("TOP 100").Select
Cells.Select
Selection.ClearContents
Sheets("Raw Data").Select
Columns("A:Y").Select
Range("Y1").Activate
Selection.ClearContents

' Refresh Data
Sheets("Raw Data").Select
Range("AI28").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("BH33").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("Reference").Select
Range("B26").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

' Sort to determine duplicates
Sheets("Raw Data").Select
Columns("BA:BP").Select
Range("BP1").Activate
Selection.Sort Key1:=Range("BA2"), Order1:=xlDescending,
Key2:=Range( _
"BB2"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
_
DataOption2:=xlSortNormal
Columns("AA:AP").Select
Range("AP1").Activate
Selection.Sort Key1:=Range("AA2"), Order1:=xlDescending,
Key2:=Range( _
"AB2"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
_
DataOption2:=xlSortNormal

' Replace Enterprise Based Support with EBS
Columns("BE:BE").Select
Selection.Replace What:="Enterprise Based Support",
Replacement:="EBS", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:= _
False, ReplaceFormat:=False

' Time Stamp
Sheets("Reference").Select
Range("H3").Select
Selection.COPY
Sheets("Instructions").Select
Range("I6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "[$-409]m/d/yy h:mm AM/PM;@"

'Ready Message
If Application.Ready = True Then
MsgBox "Application is ready."
Else
MsgBox "Application is not ready."
End If

End Sub