Results 1 to 7 of 7

on button click open textfile (from combobox1 choic - read url - goto url (relative path)

Threaded View

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    on button click open textfile (from combobox1 choic - read url - goto url (relative path)

    Hi all

    Im trying to make a relative path for the function below. My purpose is ,, by pressing commandbutton 13,, to open a textfile with url inside and then make IE go to that url. The textfile to open is choosen from what you choose in the combobox1 list. I must be close to solve it ..or maybe far away? Please look at following code. Why wont it work? :
    Private Sub CommandButton13_Click()
    Dim IE As Object
    Dim FF As Integer
     Dim filepath As String
     filepath = ActiveWorkbook.Path & "\data\url\" & ComboBox1.Value & ".txt"
    
         FF = FreeFile()
    
         Open "filepath" & ComboBox1.Value & ".txt" For Input As #FF
              Line Input #FF, StrUrl
         Close #FF
    
         Set IE = CreateObject("InternetExplorer.Application")
         IE.Visible = True
        
         IE.Navigate StrUrl
    End Sub
    Thanks in advance
    /Jan
    Last edited by Lkivagten; 08-03-2012 at 05:48 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1