Click here to Skip to main content
15,878,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I know very little about VB. I Need to code for navigating a URL on clicking link button such that navigated URL will contain an Excel file and that file should open on clicking the link button.
Posted
Updated 7-Jul-11 0:49am
v2
Comments
Prerak Patel 7-Jul-11 6:07am    
Not clear. Elaborate more. Avoid txt speak in questions.

Assuming this is a windows application (and URL is a little misleading in that respect), look at the System.Diagnostics.Process class[^]
Process.Start("F:\Temp\MySpreadSheet.xls")
 
Share this answer
 
Private Sub OpenExcelFileForEditing(ByVal OutputPath As String)
    Dim excel As Microsoft.Office.Interop.Excel.Application
    Dim wb As Microsoft.Office.Interop.Excel.Workbook

    Try
        excel = New Microsoft.Office.Interop.Excel.Application
        wb = excel.Workbooks.Open(OutputPath)
        excel.Visible = True
        wb.Activate()
        txtPath.Text = OutputPath
    Catch ex As COMException
        MessageBox.Show("Error accessing Excel: " + ex.ToString())
    Catch ex As Exception
        MessageBox.Show("Error: " + ex.ToString())
    End Try
End Sub
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900