how to query my web site from VBA and return a value to VBA

Hello All,

From VBA I would like send a value to my web site, and have it return
a value.  I've learned how to use FollowHyperlink to send a value to
an ASP script, but how can the ASP script send a value back to VBA??

Thanks,

Brian
Austin, TX
0
Brian
5/17/2010 6:02:24 AM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
1387 Views

Similar Articles

[PageSpeed] 47

You can use xmlhttp to make a request to your web page:

'*********************************************************
Sub Tester()
    MsgBox WebResponse("http://www.mydomain.com/myactualpage.asp?
info=3Dblah")
End Sub

Private Function WebResponse(sURL As String) As String

    Dim XmlHttpRequest As Object
    Set XmlHttpRequest =3D CreateObject("MSXML2.XMLHTTP")
    XmlHttpRequest.Open "GET", sURL, False
    XmlHttpRequest.send
    WebResponse =3D XmlHttpRequest.responseText

End Function
'***********************************************

Your ASP page just does something like:

'***************************
dim info
info =3D request.querystring("info")
response.write "You said '" & info & "'"
response.end
'***************************




On May 16, 11:02=A0pm, Brian Murphy <bmur...@xlrotor.com> wrote:
> Hello All,
>
> From VBA I would like send a value to my web site, and have it return
> a value. =A0I've learned how to use FollowHyperlink to send a value to
> an ASP script, but how can the ASP script send a value back to VBA??
>
> Thanks,
>
> Brian
> Austin, TX

0
Tim
5/17/2010 8:29:22 PM
Wow! That's almost too easy.
It's exactly what I was looking for.
Thanks bunches, Tim.

On May 17, 3:29=A0pm, Tim Williams <timjwilli...@gmail.com> wrote:
> You can use xmlhttp to make a request to your web page:
>
> '*********************************************************
> Sub Tester()
> =A0 =A0 MsgBox WebResponse("http://www.mydomain.com/myactualpage.asp?
> info=3Dblah")
> End Sub
>
> Private Function WebResponse(sURL As String) As String
>
> =A0 =A0 Dim XmlHttpRequest As Object
> =A0 =A0 Set XmlHttpRequest =3D CreateObject("MSXML2.XMLHTTP")
> =A0 =A0 XmlHttpRequest.Open "GET", sURL, False
> =A0 =A0 XmlHttpRequest.send
> =A0 =A0 WebResponse =3D XmlHttpRequest.responseText
>
> End Function
> '***********************************************
>
> Your ASP page just does something like:
>
> '***************************
> dim info
> info =3D request.querystring("info")
> response.write "You said '" & info & "'"
> response.end
> '***************************
>
> On May 16, 11:02=A0pm, Brian Murphy <bmur...@xlrotor.com> wrote:
>
> > Hello All,
>
> > From VBA I would like send a value to my web site, and have it return
> > a value. =A0I've learned how to use FollowHyperlink to send a value to
> > an ASP script, but how can the ASP script send a value back to VBA??
>
> > Thanks,
>
> > Brian
> > Austin, TX

0
Brian
5/18/2010 1:36:52 AM
Reply:

Similar Artilces:

Odd return situation...
A customer bought three items with cash. Two days later they returned two of them, but I had insufficient cash in my till to hand over. I wrote them a check (and entered the correct "splits" in Quickbooks, including Sales tax refunded). I then manually adjusted the quantities of these two items in Manager. Was that a bad idea? What should I have done instead? Used Store Ops to do a return but then changed to price to zero for the two items? Thanks. ______________________________________________________ Larry Leveen OlyBikes Bikes, Parts, Repairs & GREAT Customer Service! ...

Access Code Pushing Values
I have a customer database with [BillAddress] and [ShipAddress]. I am using a "yes/no" box titled[SameShipAddress?]. To automatically fill [ShipAddress] after checking the "yes/no" box I used this code in the after update event for the check box. If Me![SameShipAddress?] Then If IsNull(Me![BillAddress]) Then Else [ShipAddress] = [BillAddress] End If End If This works for the selected customer, but then pushes the entry [BillAddress] of the previous customer to [ShipAddress] of all of the following customers. Any thoughts? Sounds as...

Implementation at DR Site
Hello every body, One of my customer wants to implement Dynamics GP 9 at his DR Site. Do you have a procedure or a check list with the "Do and Dont" to replicate a prod environment, or is just a backup and restore of the company databases? Thanks in advance Regards Oswaldo, Links below might help: http://www.prlog.org/10016784-moving-microsoft-dynamics-gp-from-one-sql-server-to-another-alba-spectrum.html http://www.streetdirectory.com/travel_guide/124039/microsoft/moving_microsoft_dynamics_gp_from_one_sql_server_to_another.html Regards, -- Mohammad R. Daoud MCP, MCBMSP, M...

VBA coding
Hi everyone I am very new to vba coding. Though time to time I record macros. Some I want to edit my macro but I don't the vba codes. It there a place where all the codes/coomanda are stored. thanks Nadeem Hi the easiest way to access your macros to edit them is to choose tools / macro / macros, click on the macro you want to edit and press the EDIT button - you'll be taken directly to the appropriate code. (to get back to the workbook you can either close the code window, using the top X or use ALT & F11 to switch back and forth between the VBE Window & the workbo...

Query emails coming to a specific domain
Hello; We have about 5 domains on our exchange server that we receive email from. We are in the process of not renewing one of our domains but would like to check to see if email from that domain is still coming through. Is there any way to do that? I tried the Message Tracking Center with the *.domain.com but it didn't like that. It wanted a specific user. Thanks Check SMTP logs as well. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- <nospam@newsgroup.com> wrote in message news:...

enter value based on drop down list of another field?
I have an excel 2003 spreadsheet with 3 worksheets. In sheet 1, I created a drop down list in column A based on values in sheet 3, column A (item number). Thisd data comes from sheet 3, where I have column A (Item #'s), column B (Item desc)an Column C (price) In column B of sheet 1, I have Item Descriptions and in column C I have price. I want this to automatically fill in based on what I enter in the column A sheet 1 and it should get the corresponding values from sheet 3 column B and C. I can make the drop down list in sheet 1 column B and C, but some of the descriptions need ...

Excel Look up and Return Data
Hello all, I have a "data table" in one Excel file (call it DATA, the table is sorted on a field called 'CODE') and a second Excel file (call it FORMULA). I need to lookup information from the DATA table and return it to the FORMULA file, this will be done by matching a Raw Material Code number from the FORMULA file to the DATA table. When the code is matched, I would like to return 5 consecutive cells (in 5 consecutive columns) of data to the FORMULA file. Currently, I am using 5 vLookup functions to do this in the 5 consecutive cells. I am doing this to try to ...

Deleting Blank lines with VBA
Help I have a macro that runs multiple formulas. However, when the formulas are finished I am left with about 64000 blank lines. I am unable to insert a row on the worksheets as I get a Run-Time Error 1004 (Try to locate the last Nonblank Cell using CTRL-END). Here is a same of some of the formulas I am running ( the macro is very large). ActiveWorkbook.Names.Add Name:="TrunkFormulaI", RefersToR1C1:="=Trunks!R1C27" ActiveWorkbook.Names.Add Name:="TrunkFormulaJ", RefersToR1C1:="=Trunks!R1C28" ActiveWorkbook.Names.Add Name:="TrunkFormulaK&qu...

Returning Data from a third cell in same row that meets two other
I'm looking for a formula that will return a result from a cell on a same row as two other cells that meet certain criteria. I'm sure there is a way to do this but i am a novice at this kind of stuff and can't seem to figure it out. For example i want a cell to = what is in column E when column A="36751" and when column B="Total Returns" The spreadsheet has 55000 rows. there will only be one instance where both these criteria are met. i want to use this to create a seperate spreadsheet with just info i need and can update on a daily basis. thanks in ...

How do I filter rows based upon a column value
I have a spreadsheet that contains multiple agency id's in a column. When generating reports, I would like to filter per agency and display only the rows associated with that agency. Is there a tutorial or sample on how to do this? Hi It sounds like you are looking for Data / Filter / AutoFilter. Have a look here for some basics: http://www.contextures.com/xlautofilter01.html -- Andy. "Jack" <nfr@nospam.com> wrote in message news:eqiU08TVEHA.2988@TK2MSFTNGP10.phx.gbl... > I have a spreadsheet that contains multiple agency id's in a column. When > generati...

VBA -- protecting my sheet
Is there a way to use VBA to automatically lock (protect) my sheet every 2 hours? Only certain employees are allowed to modify it, and they are forgetting to lock it at the end of their shift. So far I have come up with this: Sub ProtectSheet() ActiveSheet.Protect (password) End Sub Can anyone point me towards a source of info on how to do this at 2 hour intervals? Thanks in advance... Josh, Use the OnTime method of the Application object. See www.cpearson.com/excel/ontime.htm for more details. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC...

ADAM Error with Web Service Installation
i need to install the Business Portal for GP 10.0 the web services is required. during the installation of the web services, i encountered an error " ADAM Error 128" what could cause this and how do i solve this? Any one help!!!!! Hi Taiwo Are the web services already installed? If they are it sounds like the issue may be that a different user account installed the web services (other then the one that is installing the BP) Fliehigh "Taiwo" wrote: > > i need to install the Business Portal for GP 10.0 > the web services is required. > during the insta...

CRM 3.0 SDK Web Services
Hi I am writing a small data migration tool to migrate account and contact data. I have approximate 1500 accounts and 6000 contacts to import to CRM 3.0. I finished the application and ran the data migration, I will able to migrate all of the account records without any problem at all. when I run the contact migration, it can migrate 2800 contact records when it get over 2800, my application throw me the following error message: The underlying connection was closed: Unable to connect to the remote server. I am running CRM 3.0, SQL server and my data migration on the same server. I am wonder w...

New Exchange Routing Group in child domain / site
I have just finished installing a child domain (leaf node) and installing a exchange server for that new domain. First problem I had was that when my email was coming in via the main domain it was sending some of the public folder emails over to the sub domain (witch I had not configured for public folders) So I placed each domain in its own routing group, created a routing connect (both ways) pointing at each other as well as SMTP Connectors with * and cost of 1 (all default settings in each location / routing group. These server will be split via a T1 and both will receive email (ma...

web server does not open
I published a website http://a542104.uscgaux.info using FP several months ago. Accessing this site for installing/maintenance requires a user ID and password. Recently when I tried to update (the website uses FP Extensions, which I had used before with no problem) the site I get an error message with several options, none of which apply. The ID and password are correct, since I can access the cpanel by using them. But now, when I try to upload new pages from my computer, the website doesn't recognize me at all and does not even ask for the ID and password. Any suggestions...

Comparing cell values then labeling them based on comparision
Hi. I'm trying to find a function or way to compare two cells and then label them according to if one cell is lesser, greater, or the same as the other. I have a large data sheet where I want to compare many pairs of cells and then have them labeled in this way. For example for each pair where the second cell value is larger than the first it would put greater, where the first is larger it would be lesser, etc. Can anybody help me with this? also feel free to email me at andrew@metiri.com. Thanks so much for your help. > Hi. I'm trying to find a function or way to compar...

Outlook Web Access #34
I have a problem reading mails from Russia usig OWA ? (it is all a lot of ?????? and maybe numbers). If I use a normal Outlook client there are no problems ? I have triet different regional settings but no luck ? Try posting this in an Exchange news group as OWA is a function of Exchange, not Outlook. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Lost asked: | I h...

query to make a list of products based on delivery history
I have a table which lists all deliveries made of our product. From this table, I'd like to make a list of all products. My problem is the products will have many duplicates as they can be ordered multiple times and I just want a list showing all the individual products that we offer. -- TIA Try something like: SELECT DISTINCT [our product] FROM [which list all deliveries made]; If you can't figure this out, come back with table and field names. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UCP http://www.access.hookom.net/UCP/Def...

Lookup returning incorrect results
Anybody have an idea why I keep getting incorrect lookup results. In sheet 1, I have a list of "Sales Codes" in col A. In sheet 2, I have a list of data that with column A for "Sales Codes" and column B for associated "Sales Reps". I want to insert a column in sheet 1 that contains lookup formulas to pull the correct sales rep for each sales code . Both sheets are sorted in ascending order by Sales code. My lookup formula in sheet 1, Lookup col B: =LOOKUP(A2,Sheet2!$A$2:$B$4,Sheet2!$B$2:$B$4) The returned results from the above lookup formula are incorrect....

Sum of values in a form
Folks, I have read numerous threads on this topic, and understand that in order for my Sum() to work I need t ensure all references are made back to the Record Source. I have endeavoured to do this, but am still getting #Error. I am trying to Sum the revenue each tenant provides in a given date range, to give a total revenue figure. If the date range is a whole month, then the expression just takes the value of Rent PCM, and not Rent PCM * No. of Days, which would give some unusual results. My Expression looks like this: =Sum(Nz(IIf([Short Let]=-1,[Rent pcm],IIf(Day([Forms]...

Update Query based on Current Recordset
I have a continuous form with filtered records. I want to run an update query on a field in a table based on the current filtered records on the form. What code would I use to accomplish this task? Any help appreciated in getting me started. NEWER USER, Without a wee bit more information, like what are you trying to update, field names, table names, do you want this attached to a button or an event, etc... The best I can do is... UPDATE SomeTable SET SomeTable.SomeField= WhateverValue WHERE (((SomeTable.SomeOtherFied)=WhateverValue)); Of course, the above would be an ...

Add cell value with mouse click
I want to create a counter, so that every time I click in a certain cell it takes the existing number and adds "1" to it. Is there any way to do this? I'm compiling statistical information, and need to get cumulative counts in various categories as I sort through the data. Hi! Maybe you can use a spinner button for this. Right click any toolbar then select Forms. Click on the spinner button ( it looks like an up arrow on top of a down arrow). Place it near the cell you want increment. Once you have it placed and sized right click on it and select Format Control. Fill in ...

Combo box default value multiautocomplete
Hi All i have a subform with 10 item. The first one is a combo box that can choose the value from a list that is linked to a table with many record. This subform is related to the master form with link master field codice,cognome,nome link child field codice,cognome,nome that are the other items that are not visualize in the subform. These link give me the right connection to the master form. Normally when i choose the value from list (table) i place also all the other item in the subform using this code in after update precedure Me.ISEE.Value = Me.ISEE.Column(0) Me.F_Costo_con_M...

VBA Help in Access 2007
When looking through the Help engine, either local or online, I get blank pages when I look at many detail pages in the Help file. For example, when looking at most all web pages in ADO (Section I: ActiveX Data Objects (ADO), there's one title line and no detail. Is that planned behavior (no data) or is there some setting or site to find information? I'm specifically looking for handling records in a table (read, process, summarize). Thanks Terryomsn =?Utf-8?B?VGVycnk=?= <Terry@discussions.microsoft.com> wrote in news:04199121-0746-4A15-B201-03F13827D29C@microso...

IIF Query for Numeric Values in Text Field
I’m attempting to flag interest rate spread errors and omissions in a file from a sales database using IIF statements I adapted from another database (I’m a novice at this). The field I’m querying is text format and contains both alpha and numeric values. When I test for a null value the IIF works fine, but when I test for a numeric value I get an #ERROR. Spread Error1: IIf(([Tbl 1 Eligible Closed Deposit Opps Appended]!Spread Is Null),1,0) Spread Error2: IIf(([CCC Fall 2007 Eligible Products]![IB/NIB]="NIB" And [Tbl 1 Eligible Closed Deposit Opps Appended]!Spread<4),1,0...