Code To Open Html File

  • Re: Code To Open Html File


    you could try this


    Code
    Private Sub CommandButton1_Click()
    If Range("A1") > 1 Then
    Shell "C:\Program Files\Internet Explorer\Iexplore.exe www.google.com"
    Else
    End If
    End Sub


    this is very basic example - but you get the picture when you click the button it checks to see if cell a1 is greater than 1 - if so launch google.com or else it does nothing.


    Hope this helps.


    Regards


    CDU311

  • Re: Code To Open Html File


    OR (sorry i thought you were meaning the internet) :rolleyes:


    Code
    Private Sub CommandButton1_Click()
    If Range("A1") > 1 Then
    Shell "F:\Microsoft Office\OFFICE11\excel.exe book1.xls"
    Else
    End If
    End Sub


    if you want to open an excel file. see whats happening? you point it to where the file is stored and it will happily open it.


    :cool:

Participate now!

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