View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default query code failes on different PC

Try...
Sheets("Invoice Due").Range("A7").QueryTable.Refresh BackgroundQuery:=False
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Leanne"
wrote in message
Hi,
I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?