ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Import file dialog (https://www.excelbanter.com/excel-programming/295754-import-file-dialog.html)

mark

Import file dialog
 
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




Bernie Deitrick

Import file dialog
 
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

"Mark" wrote in message
...
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







All times are GMT +1. The time now is 01:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com