Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014
    Posts
    98

    Unanswered: Code not working

    Can you please see why this code is not working. I am trying to open excel sheet.

    Private Sub Command126_Click()
    Dim objexcel As Excel.Application
    Dim objworkbook As Excel.Workbook
    Dim objxlsheet As Worksheet
    Set objexcel = CreateObject("Excel.Application")
    ' Set objworkbook = objexcel.Workbooks.Open("C:\MSEXCEL_TEST" & "\" & "test.xlsx")
    Set objworkbook = objexcel.Workbooks.Open(CurrentProject.Path & "\" & "Excel.xlsx")
    Set objxlsheet = objworkbook.ActiveSheet
    Set objexcel = Nothing
    End Sub

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    What does not work? Do you receive an error message ? If yes, which is it and on which line?
    Have a nice day!

Posting Permissions

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