#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 162
Default Importing Macros

I have some macros saved as .bas files that people need to be able to import
into their Excel. Their experience on importing is limited, so I need to be
able to explain to them how to import these files. Is there an easy way to
import the .bas files into Excel?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Importing Macros

Daren,

Is there a specific file that you need to have the BAS imported into, or just have it available?

In the first case, you could write a macro like this (with a reference set to MS VBA Extensibility)

Sub AddModuleByImportToPersonalXLS()
Dim myBook As Workbook
Dim myFile As String

myFile = "C:\Excel\myVBAFileName.bas"
Set myBook = Workbooks("Personal.xls")
myBook.VBProject.VBComponents.Import (myFile)
End Sub


If it just needs to be available, make your file into an add-in....

HTH,
Bernie
MS Excel MVP


"Daren" wrote in message
...
I have some macros saved as .bas files that people need to be able to import
into their Excel. Their experience on importing is limited, so I need to be
able to explain to them how to import these files. Is there an easy way to
import the .bas files into Excel?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Importing Macros

You may find it easier to create a new workbook and put all the code you want to
share with the others in that new workbook's project.

Then you can just share that workbook with others.


Daren wrote:

I have some macros saved as .bas files that people need to be able to import
into their Excel. Their experience on importing is limited, so I need to be
able to explain to them how to import these files. Is there an easy way to
import the .bas files into Excel?

Thanks.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Macros into Excel Daren Excel Discussion (Misc queries) 2 August 7th 07 09:10 AM
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
"openinf file..."ENABLE MACROS...DISABLE MACROS" F. Lawrence Kulchar Excel Discussion (Misc queries) 3 September 12th 06 10:33 AM
Importing Tables from Access into Excel using Macros or VBA CLamar Excel Discussion (Misc queries) 4 May 23rd 06 09:23 PM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"