LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Querytables parameters

I am trying to use the parameters feature of query tables and keep getting a
type mismatch. Below is code:

Dim param1 As QueryTable.Paramters
Dim param2 As QueryTable.Parameters
Dim qt As QueryTable

Set qt = Sheets("sheet1").QueryTables(1)
qt.Sql = "select wodate from natop.dbo.workmast where (wodate between ?
and ?)"
Set param1 = qt.Parameters.Add("Start Parameter", xlParamTypeVarChar)
param1.SetParam xlConstant, "01/01/2005"
Set param2 = qt.Parameters.Add("End Parameter", xlParamTypeVarChar)
param2.SetParam xlConstant, "04/01/2005"
qt.Refresh

The mismatch is coming on my first dim statement. What am I doing wrong?
 
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
QueryTables Add Marta[_3_] Excel Programming 0 January 19th 05 05:32 PM
Error when trying to use QueryTables.Add Mindblower Excel Programming 0 August 31st 04 01:44 PM
With ActiveSheet.QueryTables.Add [email protected] Excel Programming 4 January 6th 04 04:58 PM
QueryTables Interrupt if URL is Down Steve Hieb Excel Programming 0 November 17th 03 10:07 PM


All times are GMT +1. The time now is 04:40 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"