• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 704
  • Last Modified:

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!
0
IEHP1
Asked:
IEHP1
1 Solution
 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now