|
-
Oct 6th, 2009, 01:32 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Oct 6th, 2009, 06:03 AM
#2
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
-
Oct 6th, 2009, 11:37 PM
#3
Thread Starter
Hyperactive Member
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.
-
Oct 8th, 2009, 04:22 PM
#4
Thread Starter
Hyperactive Member
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.
-
Oct 14th, 2009, 05:37 PM
#5
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|