How can I calling a Subroutine from Microsoft Access?

I have a subroutine in Microsoft Access that is not a macro (it is contained in a module.) I searched and found this previously but it is used for macros. http://www.mathworks.com/matlabcentral/newsreader/view_thread/34936
I also looked up the application.Run method http://msdn.microsoft.com/en-us/library/office/ff193559.aspx
My access subroutine in the module is as follows.
Public Sub Test()
MsgBox "Hello", vbOKOnly
End Sub
My MATLAB code is as follows
Access = actxserver('Access.Application');
invoke(Access,'OpenCurrentDatabase','PathName');
invoke(Access,'Run', '"Test"');
invoke(Access.DoCmd,'Quit');
Then I get
Description: You made an illegal function call.
Error in ==> TestScripts at 3 invoke(Access,'Run','"Test"');

Answers (0)

Asked:

Ian
on 26 Nov 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!