Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Query Comma Parameter Error in MS Excel

Status
Not open for further replies.

JosephF

Technical User
Feb 20, 2008
2
US
Hello,

In Microsoft Excel 2000, I have a web query which has a parameter value of Client. I am linking the parameter to a cell from which I have a mulitselect Client list. The problem is that some of the Clients have a comma in their name and a comma is used to separate one name from another in the parameter value. I have tried adding single quotes to the Client drop down values and this does not work either. The only way it works is if I enter the Client value in the parameter section under Import External data. Any ideas on how I can get the parameter to be passed from the cell reference correctly so users can use the drop down I provided?
 



Hi,

Turn on your macro recorder and record EDITING your query and returning data to Excel, using a parameter.

Post your recorded code.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Sub keystrokes()
'
' keystrokes Macro
' Macro recorded 2/20/2008 by e023123
'

'
Application.Run "EMS_Reporting_Interface_Client.xls!ShowClientDialog"
Range("B25").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Thanks,
Joe
 
You did nothing of the kind! Please follow my instructions CAREFULLY.

For a WEB query, our code should look something like this...
Code:
    With Selection.QueryTable
        .Connection = "URL;[URL unfurl="true"]http://www.tek-tips.com/tipmasters.cfm?pid=68"[/URL]
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = """mtable"""
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
Where is your PARAMETER?

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top