Results 1 to 5 of 5

Thread: [RESOLVED] First User Form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2009
    Posts
    448

    Resolved [RESOLVED] First User Form

    I have a Userform Made. I need the code to call it with a togglebutton on the spreadsheet.
    then I need the code that completes the Hyperlink as explained below.
    LABEL<PROJ>TEXTBOX<ENTER PROJ NUMBER HERE> COMMANDBUTTON<HYPERLINK ACTIVATE>
    I just need whatever is in the textbox to complete the hyperlink.
    PREFIX "http://abc.mycmpny.com/abc_drw/qr/"&"textbox data".

    http://abc.mycmpny.com/abc_drw/qr/049410-001
    Commandbutton activate link.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: First User Form

    Try
    Code:
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    
    Private Sub CommandButton1_Click()
    Dim lngOpenPage As Long
    lngOpenPage = ShellExecute(Application.hwnd, "Open", "http://abc.mycmpny.com/abc_drw/qr/" & TextBox1.Text, 0&, 0&, 0&)
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2009
    Posts
    448

    Re: First User Form

    I know where to put this.
    Code:
    Private Sub CommandButton1_Click()
    Dim lngOpenPage As Long
    lngOpenPage = ShellExecute(Application.hwnd, "Open", "http://abc.mycmpny.com/abc_drw/qr/" & TextBox1.Text, 0&, 0&, 0&)
    End Sub
    But where do I put this?
    Code:
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    I think I got it. I put it in the General Declaration thing.
    Last edited by tome10; Oct 7th, 2009 at 12:07 AM.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2009
    Posts
    448

    Re: [RESOLVED] First User Form

    I have a TextBox in my form and a Command Button calls a Hyperlink.
    problem is Now I have a Hyperlink that needs FirstName LastName.
    I would rather not Build 2 text boxes, and am wondering how you would go about splitting the entry seperated by a space, and then using the 2 sets of data in the HyperLink.

    http://edirectory.mycompany.com/ldap...name=FirstName
    Last edited by tome10; Oct 8th, 2009 at 04:25 PM.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2009
    Posts
    448

    Re: [RESOLVED] First User Form

    This is what I have. It errors on the Hyperlink saying it needs a seperator or something. Also, I am not sure my split thing is working. Yea I don't think it should have Range there.

    Code:
        Private Sub CommandButton1_Click()
                Dim lngOpenPage As Long
                Dim First As Variant
                Dim Last As Variant
                First = Split("Textbox1.text", " ")   'Textbox1=John Doe
                Last = Split("Textbox1.text", " ")   'Textbox1=John Doe
                lngOpenPage = ShellExecute(Application.hwnd, "Open", "http://edirectory.MyCompany.com/ldap/CorpDirServlet?snMatch=exact&givennameMatch=exact&action=FindEmployee&sn=(Last)&givenname=(First)&MiddleInitial=&telephoneNumber=, 0&, 0&, 0&) 'It errors here saying I needed a Seperator or something. What are the 0&, 0&, 0& For?
            
        End Sub
    The Middle Initial and Telephone are not needed. I think I could actually take them off, but that is the way it shows up so.
    Last edited by tome10; Oct 14th, 2009 at 06:07 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width