Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ward376 wrote:
I'm not positive, because your adding the query table connection with code, but query tables are associated with automatically created named ranges and when they're deleted, the query is also. It may also have to do with your variable rng but I don't know how your setting it. Ward376 Yeah it doesn't make too much sense to me especially if the code for the qurey table connection remains COMPLETELY UNCHANGED and works PERFECTLY until the .DELETE is introduced. So I guess the question is why does .CLEAR works fine but not .DELETE?? Very odd in my opinion, really don't think it has anything to do with the variables. But here's the ranges spelled out. And the reason I'm using variables is I'm pulling data from 15 different website tables and placing them into 8 different excel worksheets. Again thanks for the help and education Ward! ......................................... Set pgname = Sheet2 Set rng = pgname.Range("A1") WEBQUERY: pgname.Range("A1:R100").Clear With pgname.QueryTables.Add(Connection:= _ "URL;" & mwURL & scantype & "" _ , Destination:=rng) ......................................... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
Macro that runs entered value through "low" and "high" range | Excel Programming | |||
"Subscript out of range" error for: Workbooks("Test1.xls").Save | Excel Programming | |||
RunTime Error "1004" QueryTable is Invalid | Excel Programming | |||
"Run-time error '1004'" Method 'Range' of object '_global' failed. | Excel Programming |