In MS Access 2010,I am trying to write some code to a module that I can then use RunCode to run from an AutoExec macro. I have written the code that I think should go in the module and get no errors when I debug/compile it. But when I try to use Runcode and run the macro I get error message 2425 which states "the expression you entered has a function name the Microsoft Access can't find." I checked to make sure that the name of the function called by RunCode was correct. So now, I can't tell what the problem is. Here is my code:
Code:
Function OpenExcelFromAccess() Dim MyXL As Object Set MyXL = CreateObject("Excel.Application") With MyXL .Application.Visible = True .Workbooks.Open "S:\DateCodes.xlxs" End With End Function
Comment