LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Run Time Error 1004: Application-Defined or Object-Defined Error

On Apr 16, 3:11 pm, "Diana" wrote:
On Apr 16, 2:05 pm, "George Nicholson"
wrote:





shouldn't "With ws" (the Sheet array) be "With sh" (the current member of
the array)?


It would certainly explain "Object doesn't support this property or method"
errors.


HTH,


"Diana" wrote in message


ups.com...


On Apr 13, 12:11 pm, "Diana" wrote:
On Apr 13, 11:38 am, urkec wrote:


What values do you get if you


MsgBox sSql
MsgBox sConn


before


==Here is where the error is happening:


Set oQt = sh.QueryTables.Add(Connection:=sConn, _
Destination:=sh.Range("A8"), _
SQL:=sSql)


--
urkec


Hello again urkec!


The message boxes give me these values:


MsgBox sSql = And(PO.Order_Date Between '3/1/2006' and '4/13/2007'))
Order By Items.Itemno
MsgBox sConn = WSID=AndyHP5300;Database=Everest_VGI;Network=DBMS


Pretty cool, didn't know you could put a message box right in the
middle of things like that!


Okay so I've been working with the code, and have been able to get the
error to at least change...now I'm getting "Run-Time Error 438 Object
doesn't support this property or method" at the same line. Here is
what I added:


Set ws = Sheets(Array("Inventory Analyzer", "Last 30 Days", "Last 90
Days", "Last 180 Days", "Last 360 Days"))


For Each sh In ws
cellValue1 = sh.Range("B3").Value
cellValue2 = sh.Range("B4").Value


sSql..........
sConn.......


==Error is he


With ws
Set oQt = .QueryTables.Add(Connection:=sConn, _
Destination:=.Range("A8"), _
SQL:=sSql)
End With
Next- Hide quoted text -


- Show quoted text -


Hehe...you just may be right...however, doing that gives me the 1004
error again! Whoopie!

Back to square four (not one because I"m further along than that)!

Thanks for the reply =)- Hide quoted text -

- Show quoted text -


Any other suggestions? I'm about to give up on this thing, har har...

Thanks!

 
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
Run Time Error 1004 - Application-defined or object-defined error brent Excel Programming 2 October 3rd 05 05:23 PM
Run-time Error 1004: Application-defined or Object-defined Error Adrian Excel Programming 6 August 23rd 05 06:28 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"