Hi all,
I have the following code (for which I apologise most sincerely) in an Excel spreadsheet that compacts an Access database to a separate location and then opens it. Is it possible to then run a macro stored in the database from the code in Excel?
I have the following code (for which I apologise most sincerely) in an Excel spreadsheet that compacts an Access database to a separate location and then opens it. Is it possible to then run a macro stored in the database from the code in Excel?
Code:
Dim StandardDBM As Database
Dim NewDBM As Database
StandardDBM = "D:\Exported Data\Reports\Standard\ManStandard.mdb"
NewDBM = "D:\Exported Data\Reports\" & LastMonthDate & "\ManReport - " & LastMonthDate & ".mdb"
DBEngine.CompactDatabase StandardDBM, NewDBM
Dim MyDBM As Object
Set MyDBM = GetObject(NewDBM)
MyDBM.Application.Visible = True
Set MyDBM = Nothing[\code]
The macro that I want to run is called mcrFinalise.
Regards,
Alan