Import file dialog

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I am using excel 97.

I want to try and ease the way a module/form/class module
is imported into a project by way of another macro.

I am using the code:-

ActiveWorkbook.VBProject.VBComponents.Import
FileName:="Mymodule"

But I want to take things step further, if it's possible
by importing a module and being able to choose it from a
Import file dialog.

Ideally from Excel itself and not the VBA editor window.

Is it possible, and if so can someone assist, please?

Mark
 
Mark,

Use code to ask for the filename:

Dim myFile As String
myFile = Application.GetOpenFilename
ActiveWorkbook.VBProject.VBComponents.Import _
Filename:=myFile

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top