Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default QueryTables Object Variable or With Block Variable Not Set

When I run the code below (the IP is masked) using the F8
button in VBA it runs fine, but when I try to us it in run
time I get the Error 91 Object variable or with block
variable not set.

How can I overcome this?

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://" _
& "123.12.12.12" _
& "/MD/version.asp" _
& "?MyPassword=MD1234" _
, Destination:=ActiveWorkbook.ActiveSheet.Range
("A1"))
.Name = ""
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = False
.Refresh BackgroundQuery:=False
End With
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
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
object variable or with block variable not set Diego Excel Discussion (Misc queries) 1 August 9th 05 02:46 PM
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM
Error 91 - Object variable with block variable not set Jim[_35_] Excel Programming 2 November 27th 03 03:34 AM
Object Variable or With Block variable not set? Chris M.[_3_] Excel Programming 3 August 26th 03 04:30 PM


All times are GMT +1. The time now is 12:45 AM.

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"