G
Guest
i've been on the threads for the last two days, and i'm not making any
headway. I want to place on an Access Form a button that launches an Excel
Spreadsheet. I see that this question is asked quite frequently, but all the
answers are not working for me. Here's what I'm doing:
Step One: I'm in the Design View of the Access Form
Step Two: I right-click on the button
Step Three: I select Build Event
Step Four: I click on Modules Folder and then right-click, and then scroll
down to Insert, then select Module
Step Five: I select Module1 from the folder
Step Six: I select Tools => References, and then I add Microsoft Excel Object
Step Seven: I ONLY add this code, nothing more:
Dim appExcel As Excel.Application
Dim wbExcelFile As Excel.Workbook
Set appExcel = CreateObject("Excel.Application")
Set wbExcelFile = appExcel.Workbooks.Open("K:\Data Directories\test.xls")
wbExcelFile.Sheets("test").Select
Step Eight: I get an error that says: compile error: invalid outside procedure
Can you please give me the Entire code that I need, or if I'm doing
something wrong.
headway. I want to place on an Access Form a button that launches an Excel
Spreadsheet. I see that this question is asked quite frequently, but all the
answers are not working for me. Here's what I'm doing:
Step One: I'm in the Design View of the Access Form
Step Two: I right-click on the button
Step Three: I select Build Event
Step Four: I click on Modules Folder and then right-click, and then scroll
down to Insert, then select Module
Step Five: I select Module1 from the folder
Step Six: I select Tools => References, and then I add Microsoft Excel Object
Step Seven: I ONLY add this code, nothing more:
Dim appExcel As Excel.Application
Dim wbExcelFile As Excel.Workbook
Set appExcel = CreateObject("Excel.Application")
Set wbExcelFile = appExcel.Workbooks.Open("K:\Data Directories\test.xls")
wbExcelFile.Sheets("test").Select
Step Eight: I get an error that says: compile error: invalid outside procedure
Can you please give me the Entire code that I need, or if I'm doing
something wrong.