Hi Dan,
i am looking for something where i click on the button and the excel sheet opens. i have created buttons on the VB excel but i am looking for the coding about how should i link the excel sheet with the command button? please can you help?

regards,
krishan

Private Sub Command1_Click()

On Error GoTo ErrHandler
    Dim xlApp As Object
    Dim xlWB As Object

    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True

    Set xlWB = xlApp.Workbooks.Open("c:\MySheet.xls")
    Exit Sub

ErrHandler:
    MsgBox "There is a problem opening that workbook", vbCritical, "Error!"

End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.