Running sub procedure in Excel from Access

DrQuality

New member
Local time
Today, 23:45
Joined
Jul 16, 2002
Messages
6
Hello! I've got a fairly complex problem here I think... so please bear with me!

K... I have a table in Access, that I've already exported to Excel. Now I have vba code in a sub procedure called MultOLS in Excel (this sub procedure creates another worksheet in that workbook, which I then want to import back into Access). I realize that I could just go into Excel and run the code from there, but I'd like to run the whole operation from Access if possible. I know how to do the importing and exporting from excel to access, I just need help with running that sub procedure in excel from access. It may be noted that no variables need to be passed from Access to Excel in this operation, I just want Access to tell Excel to run that code! Thank you very much for any help!!!

- Mike
 
My previous experience with working with Excel from Access always got me into running the whole code totally from Access. I created the code at Excel through macro recording and then I copy the codes to Access and run them from there after some modifications because the object references do not port as-is. However, if you need to run the procedure from Excel itself, I could only make a guess but not give you the code since I haven't tried it myself. I think you can create a toolbar icon that runs your procedure when clicked. Then all you have to do in Access is sort of what you do when you run a command, ie docmd.RunCommand. Obviously, this method will be very impractical if the program is multiuser.
 

Users who are viewing this thread

Back
Top Bottom