Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

In Excel 97, how can I use a text file containing VBA code to create a code module in a workbook at run-time?

0
Posted

In Excel 97, how can I use a text file containing VBA code to create a code module in a workbook at run-time?

0

In Excel 97 VBA, code modules and other parts of a VBA project belong to the VBComponents collection of the VBProject object for a given workbook. Creating a new code module at run-time requires you to add a new item to the VBComponents collection. To access these objects, you first need to set a reference to the Visual Basic for Applications Extensions library in the project where the module creating code will go. To do this, activate that project in the VBE, choose Tools/References from the VBE menu and place a check mark beside the VBA Extensions object library.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.