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

Excel Macro to Run Access Macro Error

Run-Access-Macro-From-Excel-Erro.pdf Run-Access-Macro-From-Excel-No-E.pdf
I copied a macro to run an Access macro from Excel from a course spreadsheet (Excel & Access Integration with Office 2007 by Alexander & Clark) into a spreadsheet. When I step into execution in my new spreadsheet, I get a "Compile Error: User-defined type not defined" See attached file. When I step into it from the course file, it works - see attached file no error. What needs to be done to get it to run in my spreadsheet? The code is in both attached files.
0
jhb126
Asked:
jhb126
  • 3
  • 2
  • 2
1 Solution
 
leonstrykerCommented:
There is a reference to Access in the book file. Go to Tools\References and compare.
0
 
leonstrykerCommented:
You are looking for something like:

Microsoft Access 12.0 Object Library
0
 
jhb126Author Commented:
The Microsoft DAO 3.6 Object Library was in the no error file but not in the error file. I checked it, but still got the same error. Attached are the screen captures of the reference list for both files.
Error-VBA-Reference-list.pdf
No-error-VBA-Reference-list.pdf
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
Saqib Husain, SyedEngineerCommented:
On the error file go to tools > references.
Scroll down the list and you will find an unchecked instance of
Microsoft Access 12.0 Object Library
Check this and click OK

You will now be able to run the program
0
 
leonstrykerCommented:
How is the answer selected different from what I was saying?
0
 
Saqib Husain, SyedEngineerCommented:
jhb126,

leonstryker had already proposed this solution but you probably did not see it all the way. I simply guided you through what leonstryker had proposed. Please reopen the question and award him points. If you think my comment was valuable you can split the points.

Saqib
0
 
jhb126Author Commented:
I think leonstryker did propose a solution, but it was incomplete in that what resolved the issue was checking the second instance of the Access 12.0 Object Library. One was already checked so the comparison din't lead to the solution. However, leonstryker did know what needed to be done. I think splitting the points would be a good resolution
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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