Load VBA code from a text file

If you want to import source code from a text file, you can use the following code.

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

Analysis Office - The Comprehensive Guide
Analysis Office - The Comprehensive Guide is a pdf book about SAP BusinessObjects Analysis Office. It is based on Analysis Office 2.3 and contains 227 Pages.
29,99 €
Analysis Office - The Comprehensive Guide 2nd edit
Analysis Office - The Comprehensive Guide is a pdf book about SAP BusinessObjects Analysis Office. It is based on Analysis Office 2.4 and contains 243 pages.
39,99 €

Write a comment

Comments: 0