I have implemented a automated import+version controlling for excel-modules (bas, frx and frm files), so the clients will always get the newest version of VBA scripts.
The solution is something like this:
- A vba scripts (on Workbook_Open) checks the github repository if the version number is equal
- If not, the script will now do following
- Download main.zip from github
- Extract the zip files
- Remove all existing modules
- Import all modules
But the problem is, when importing modules, somehow the special characters in bas/frm/frx files will not be kept, they will be encoded to something else like:
- pensionSheet.Cells(26, 2).value = JsonObject("Børnerente")
It should be
- pensionSheet.Cells(26, 2).value = JsonObject("Børnerente")
Iam using this following function to import bas modules:
Function addBasFile(strPath As String)
Dim path As String
Dim objModule As Object
path = strPath & "\pb_integration-main\pensionBrokerExport.bas"
Set objModule = Application.VBE.ActiveVBProject.VBComponents.Import(path)
objModule.Name = "PensionBrokerExport"
Debug.Print ("PensionBrokerExport imported")
End Function
Any idea how i can keep special chars when importing modules to excel?