If you want to import source code from a text file, you can use the following code.
1 2 3 4 5 6 7 8 9 10 11 12 |
Sub fromTextFile() Dim CodeModul As CodeModule Dim i As Integer Const Importfile = "c:Macro.txt" Set CodeModul = ThisWorkbook.VBProject.VBComponents("NewModule").CodeModule With CodeModul .AddFromFile Importfile End With End Sub |
These posts might also be interesting:
author.
I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.
Schreibe einen Kommentar