Consulting

Results 1 to 2 of 2

Thread: Write To Web Page

  1. #1

    Exclamation Write To Web Page

    hi,

    please see this code first:

    Option Explicit
    ' Add a reference to Microsoft WinHTTP Services
    Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0
    
    
    Public Sub WriteToWebsite()
    Dim MyCon As New WinHttpRequest
    Dim SendAuthor As String
    Dim SendMessage As String
    
    'variable to send
    SendAuthor = Sheet1.Range("B3").Value
    SendMessage = Sheet1.Range("B6").Value
    
    If SendAuthor = "" Or SendMessage = "" Then
    MsgBox "Enter Author and Message"
    Exit Sub
    End If
    
    'Connection string to send
    MyCon.Open "GET", _
    "http://www.yoursite.com/get.php" & _
    "?GetAuthor=" & SendAuthor & _
    "&GetMessage=" & SendMessage
    
    'send it
    MyCon.Send
    
    'clear contents
    Sheet1.Range("B3").ClearContents
    Sheet1.Range("B6").ClearContents
    End Sub
    
    Public Sub GoThere()
    Dim newsite As Object
    
    Set newsite = CreateObject("InternetExplorer.application")
    newsite.Visible = True
    newsite.Navigate _
    "http://www.yoursite.com/display.php"
    
    End Sub

    this code use 2 cells to send it to web site page,

    the quistion is: what should i add or change to make it use several cells to send theme to the page ?

    from example:

    i want send cell A1 AND C3 AND BA1 and so and so etc...

    any help
    web_sailor@hotmail.com

  2. #2
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    I'm no expert on this, but isn't just as easy as:
    [vba]"?GetAuthor=" & Range("A1").Value & "+" & Range("A2").Value & ' ...[/vba]
    Just adding a "+" to make it say "and/or" in the request? I'm not sure that's how it works, but you could try.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •