Actually, the question's a little more involved than that. Let me try to explain as succinctly as I can.
I want to know how to execute code that is held within the project I'm trying to open using Application Automation.
To give an example to illustrate the concept :
I have in most of my Excel files a public function (ToA1()) that converts Rows and Columns from simple numbers to A1 notation. When I open one of these files from an Access database project, I would like to call this function from within my Access code (the part where it's working within the spreadsheet), but that is proving difficult (to say the least).
After doing some googling, I found the Application.Run() function, which allows me to execute macros (I'm guessing just subroutines), but I need it to return the value to me if possible. One negative side-effect of this for me is that ALL parameters must be passed positionally. I'm a heavy user of named arguments in my code, for reasons of clarity.
The only alternative I can see is to duplicate all my Excel routines into a separate module in my database. Not the end of the world, but not ideal either. Maintenance would be an issue, trying to avoid code getting out of synch.