VB Form : filename in a textbox can it be a hyperlink/link

  • Is there a way to make a filename a hyperlink or link within a text box?


    My current code (below) just copies the workbook name.


    Is there a way so that someone could click on the filename in the text box and it would go to that location.


    I.e file is in c:\local\a.xls, this location shown the textbox1, by someone clicking on this it goes to this location in say explorer or opens the worksheet??


    Private Sub UserForm_Initialize()


    Set wb = ActiveWorkbook
    TextBox1.Text = wb.FullName


    End sub

  • Hi xlite,


    That would be great but the textbox is in an email type form so i would prefer that they just clicked on a location. I have sent my current spreadsheet, click on open form (if it does not automatically) and then the top left button in the form.


    The email form shows a location in the textbox where the form has been saved to i.e r:\local\


    I want it so someone can just click on this location and it opens explorer for example


    SEE NEXT POST FOR CORRECT SHEET

  • hi stevehorton09,


    sorry a bit confused here,


    do you mean you need a "Browse" button whereby a user browse for a file
    and once selected, the whole path is reflected in a textbox?


    cheers
    xlite

    Cheers
    ___________
    Xlite :sheep:
    [st]All you need to learn VBA is an internet connection and Ozgrid.com[/st]

  • Sorry bet its me,


    The user fills in a form and presses send.


    An email is then populated telling the approver where the form the user has just filled is located.


    i.e r:\local\


    Afetr it has been sent, I would like the location (shown in the email) to be a hyperlink or a link.


    I want the approver to either click on location in the email and be taken to the spreadsheet


    OR


    The approver clicks on the location in the email and they are taken into the folder itself and can llok for the file


    hope this helps!

  • hi steve,


    from yr file i gather you have developed your own xl email.


    if i understand correctly, the user will be saving a fille somewhere
    and the approval wants to know where its location is.


    i'd use the GetSaveAsFilename method (place the output somewhere in yr email, here i place it in A1)


    then you need a link for the approver to click.


    i found a nice example at John Walkenbach's site:
    http://j-walk.com/ss/excel/tips/tip71.htm


    i have modified his example slightly as attached


    HTH
    xlite

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!