Xpert
New Member
- Joined
- Jul 18, 2005
- Messages
- 20
I'm trying to find VBA code to convert Macros to Visual Basic Modules.
I've found that it can be done in versions of Access higher than 97 (see below), but the some of objects used in Access 2000 or higher are not found in Access 97. I've bolded the ones that I can't find in 97...
Sub AllMacros()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllMacros collection.
For Each obj In dbs.AllMacros
DoCmd.SelectObject acMacro, obj.Name, True
DoCmd.RunCommand acCmdConvertMacrosToVisualBasic
Next obj
Set dbs = Nothing
End Sub
Can anyone help?
I've found that it can be done in versions of Access higher than 97 (see below), but the some of objects used in Access 2000 or higher are not found in Access 97. I've bolded the ones that I can't find in 97...
Sub AllMacros()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllMacros collection.
For Each obj In dbs.AllMacros
DoCmd.SelectObject acMacro, obj.Name, True
DoCmd.RunCommand acCmdConvertMacrosToVisualBasic
Next obj
Set dbs = Nothing
End Sub
Can anyone help?