Hello E Experts:
I have found a few posts on this subject but they don't quite cover all the information I need. I have an Access query that has 12 months of data (there is a month field where the user inputs which month to query). I would like to cycle through this query and export each months' data into a new separate worksheet in one existing excel file.
The primary problem is getting the VBA to open file, and populate the worksheets. Using the following code, I get a "User-Defined Type Not Defined" error. I read a lot on 'late binding' vs 'early binding', etc. Its been a while since I coded in VBA so I cannot remember whether those would have any significance with this issue.
Dim oApp as Excel.Application
Dim oFile as Excel.Workbook
Dim oSheet as Excel.Worksheet
I've not used the "Excel." parameter before in access 2007.
So, I be much appreciative of some guidance that provides a solution to addressing the above error and how to automate cycling through of the various months for export.
Thanks in advance!