Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamically loading external macros, on the fly


I'm am trying to create somewhat of a scripting scheme so that the en
user can format their reports, but not be limited to just what m
scripting scheme offers. Basically, i want people who are not familia
with the macro side of excel to still be able to do powerful things
such as customization.

In order to complete this project, i imagine i will need to load .ba
files, or text files containing macros on the fly.

If i have a directory called "\scripts", how can i run a text file i
that directory as a macro?

thanks,
sp00

--
sp00ni
-----------------------------------------------------------------------
sp00nix's Profile: http://www.excelforum.com/member.php...nfo&userid=393
View this thread: http://www.excelforum.com/showthread.php?threadid=52381

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default dynamically loading external macros, on the fly

From Chip Pearson's site - shows how to export to a text file, then import
into another workbook.

Sub CopyOneModule()

Dim FName As String
With Workbooks("Book2")
FName = .Path & "\code.txt"
.VBProject.VBComponents("Module1").Export FName
End With

' --- line your looking for ---
Workbooks("book1").VBProject.VBComponents.Import FName

End Sub

http://www.cpearson.com/excel/vbe.htm

--
Regards,
Tom Ogilvy


"sp00nix" wrote in
message ...

I'm am trying to create somewhat of a scripting scheme so that the end
user can format their reports, but not be limited to just what my
scripting scheme offers. Basically, i want people who are not familiar
with the macro side of excel to still be able to do powerful things,
such as customization.

In order to complete this project, i imagine i will need to load .bas
files, or text files containing macros on the fly.

If i have a directory called "\scripts", how can i run a text file in
that directory as a macro?

thanks,
sp00n


--
sp00nix
------------------------------------------------------------------------
sp00nix's Profile:

http://www.excelforum.com/member.php...fo&userid=3934
View this thread: http://www.excelforum.com/showthread...hreadid=523810



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamically loading external macros, on the fly


thanks to

--
sp00ni
-----------------------------------------------------------------------
sp00nix's Profile: http://www.excelforum.com/member.php...nfo&userid=393
View this thread: http://www.excelforum.com/showthread.php?threadid=52381

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
Dynamically Loading Macro with data Fred Charts and Charting in Excel 0 July 6th 06 02:21 AM
Disable Macros when loading a Workbook in Excel 2000 Remy[_3_] Excel Programming 4 December 16th 05 08:07 PM
Printing subset of pages dynamically using excel macros nsgargya Excel Discussion (Misc queries) 1 September 28th 05 08:18 PM
External SQL Data not updating in spreadsheet when loading in OWC Chris Tromans Excel Programming 0 May 18th 05 06:16 PM
Macros loading under XL2003 S G Booth Excel Programming 2 March 4th 05 06:06 AM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"