Greetings,
I have tried two methods to export VBA modules. Neither for me produce complete hidden headers that the manual export user interface includes. This results in VBA not being able to import them successfully.
I have tried the following two VBA implementations:
1) VCS code originated from https://github.com/timabell/msaccess-vcs-integration/
which uses this method to extract out from Access / VBA the individual module files:
Application.SaveAsText obj_type_num, obj_name, file_path
2) When I discovered the error with this, then I found this other way to do "the same thing"...
The issue both of these automated methods have:
Manually exported via the VBA editor has the following header lines before the VBA code:
When I use either of these VBA automated ways of exporting the same module, the resulting export file only has these header lines:
How do I get around this bug and successfully export via VBA automation?
I am thankful,
I have tried two methods to export VBA modules. Neither for me produce complete hidden headers that the manual export user interface includes. This results in VBA not being able to import them successfully.
I have tried the following two VBA implementations:
1) VCS code originated from https://github.com/timabell/msaccess-vcs-integration/
which uses this method to extract out from Access / VBA the individual module files:
Application.SaveAsText obj_type_num, obj_name, file_path
2) When I discovered the error with this, then I found this other way to do "the same thing"...
Code:
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase (strAccessDBFullFilename)
Set objProj = appAccess.VBE.ActiveVBProject
If objProj Is Nothing Then
Debug.Print "ExportModule_ExportAllModules objProj was Nothing"
GoTo Exit_ExportModule_ExportAllModules
End If
For Each objComponent In objProj.VBComponents
'Export the files as *.bas files
objComponent.Export strAccessModuleExportFullPath & objComponent.Name & ".bas"
Next objComponent
Manually exported via the VBA editor has the following header lines before the VBA code:
Code:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "clsObjProjectsTbl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Code:
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
I am thankful,