Open Excel File using Access Form Button

HI Experts,

I am looking a VBA script for a form button which opens an excel file and goes to a specific worksheet.

For example,
(1) click on the button
(2) open specific excel file ("report.xlsx")
(3) go to specific worksheet ("sheet1")

Thanks!
IEHP1Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
private sub btn_click()

dim objXl  as object
set objXl=createobject("excel.application")

      objxl.workbooks.open "c:\report.xlsx"

      objxl.visible=true
      objxl.worksheets("sheet1").activate

end sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.