Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Using or loading external code

Hi

I have a spreadsheet which uses a number of macros and forms to control
entering of data relating to a product. Each new product requires a new
instance of the spreadsheet so I open a 'Master' copy and then save with a
new name.
Creating copies in this way gives a problem if I edit any of the code or
form structure as I have to go back through each instance and import the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and access this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current modules
(apart from the one containing itselr) and froms then import the code from an
external file? In other words automate the task I am having to do.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Using or loading external code

Look at VBIDE.CodeModule.AddFromFile.
You will need a reference to the VBE extensibility library.
Bear in mind that after importing the code it will need a re-compile, so
all your variables will be reset and forms will need to be unloaded etc.

RBS

"GDCobra" wrote in message
...
Hi

I have a spreadsheet which uses a number of macros and forms to control
entering of data relating to a product. Each new product requires a new
instance of the spreadsheet so I open a 'Master' copy and then save with a
new name.
Creating copies in this way gives a problem if I edit any of the code or
form structure as I have to go back through each instance and import the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and access this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current modules
(apart from the one containing itselr) and froms then import the code from
an
external file? In other words automate the task I am having to do.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Using or loading external code

Thanks for the reply RB. Please excuse my ignorance, I have looked for
information on 'VBIDE.CodeModule.AddFromFile' (and the individual
constituents) in the help file but nothing comes back. Just to clarify I am
programming this through the VB environment in Excel 2003, am I looking in
the right place?

"RB Smissaert" wrote:

Look at VBIDE.CodeModule.AddFromFile.
You will need a reference to the VBE extensibility library.
Bear in mind that after importing the code it will need a re-compile, so
all your variables will be reset and forms will need to be unloaded etc.

RBS

"GDCobra" wrote in message
...
Hi

I have a spreadsheet which uses a number of macros and forms to control
entering of data relating to a product. Each new product requires a new
instance of the spreadsheet so I open a 'Master' copy and then save with a
new name.
Creating copies in this way gives a problem if I edit any of the code or
form structure as I have to go back through each instance and import the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and access this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current modules
(apart from the one containing itselr) and froms then import the code from
an
external file? In other words automate the task I am having to do.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Using or loading external code

Did you add the reference in the Excel VBE under Tools, References?
If you have done that then look in the object browser under Classes:
CodeModule and then
in right pane Member of CodeModule: AddFromFile.
Right-click that and click the help.

RBS


"GDCobra" wrote in message
...
Thanks for the reply RB. Please excuse my ignorance, I have looked for
information on 'VBIDE.CodeModule.AddFromFile' (and the individual
constituents) in the help file but nothing comes back. Just to clarify I
am
programming this through the VB environment in Excel 2003, am I looking in
the right place?

"RB Smissaert" wrote:

Look at VBIDE.CodeModule.AddFromFile.
You will need a reference to the VBE extensibility library.
Bear in mind that after importing the code it will need a re-compile, so
all your variables will be reset and forms will need to be unloaded etc.

RBS

"GDCobra" wrote in message
...
Hi

I have a spreadsheet which uses a number of macros and forms to control
entering of data relating to a product. Each new product requires a
new
instance of the spreadsheet so I open a 'Master' copy and then save
with a
new name.
Creating copies in this way gives a problem if I edit any of the code
or
form structure as I have to go back through each instance and import
the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and access
this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current modules
(apart from the one containing itselr) and froms then import the code
from
an
external file? In other words automate the task I am having to do.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Using or loading external code

RB - What should I be linking under ToolsReferences?
There's nothing n the availible list that looks like a likely candidate and
if I click on browse it is looking for olb, tlb or dll files. Should I be
compiling my code and linking to that. Sorry for being a numpty but I'm just
about to finish for the night so I'm in a bit of a hurry. Thanks for your
help so far, I feel I am getting somewhere.

"RB Smissaert" wrote:

Did you add the reference in the Excel VBE under Tools, References?
If you have done that then look in the object browser under Classes:
CodeModule and then
in right pane Member of CodeModule: AddFromFile.
Right-click that and click the help.

RBS


"GDCobra" wrote in message
...
Thanks for the reply RB. Please excuse my ignorance, I have looked for
information on 'VBIDE.CodeModule.AddFromFile' (and the individual
constituents) in the help file but nothing comes back. Just to clarify I
am
programming this through the VB environment in Excel 2003, am I looking in
the right place?

"RB Smissaert" wrote:

Look at VBIDE.CodeModule.AddFromFile.
You will need a reference to the VBE extensibility library.
Bear in mind that after importing the code it will need a re-compile, so
all your variables will be reset and forms will need to be unloaded etc.

RBS

"GDCobra" wrote in message
...
Hi

I have a spreadsheet which uses a number of macros and forms to control
entering of data relating to a product. Each new product requires a
new
instance of the spreadsheet so I open a 'Master' copy and then save
with a
new name.
Creating copies in this way gives a problem if I edit any of the code
or
form structure as I have to go back through each instance and import
the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and access
this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current modules
(apart from the one containing itselr) and froms then import the code
from
an
external file? In other words automate the task I am having to do.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Using or loading external code

Look for:
Microsoft Visual Basic for Applications Extensibility 5.3
The number could be different.

RBS

"GDCobra" wrote in message
...
RB - What should I be linking under ToolsReferences?
There's nothing n the availible list that looks like a likely candidate
and
if I click on browse it is looking for olb, tlb or dll files. Should I be
compiling my code and linking to that. Sorry for being a numpty but I'm
just
about to finish for the night so I'm in a bit of a hurry. Thanks for your
help so far, I feel I am getting somewhere.

"RB Smissaert" wrote:

Did you add the reference in the Excel VBE under Tools, References?
If you have done that then look in the object browser under Classes:
CodeModule and then
in right pane Member of CodeModule: AddFromFile.
Right-click that and click the help.

RBS


"GDCobra" wrote in message
...
Thanks for the reply RB. Please excuse my ignorance, I have looked for
information on 'VBIDE.CodeModule.AddFromFile' (and the individual
constituents) in the help file but nothing comes back. Just to clarify
I
am
programming this through the VB environment in Excel 2003, am I looking
in
the right place?

"RB Smissaert" wrote:

Look at VBIDE.CodeModule.AddFromFile.
You will need a reference to the VBE extensibility library.
Bear in mind that after importing the code it will need a re-compile,
so
all your variables will be reset and forms will need to be unloaded
etc.

RBS

"GDCobra" wrote in message
...
Hi

I have a spreadsheet which uses a number of macros and forms to
control
entering of data relating to a product. Each new product requires a
new
instance of the spreadsheet so I open a 'Master' copy and then save
with a
new name.
Creating copies in this way gives a problem if I edit any of the
code
or
form structure as I have to go back through each instance and import
the
affected modules and forms previously exported from the MASTER.

So. is it possible to have my code loaded in separate file and
access
this
remotely from the spreadsheets?
OR
Create a macro in the spreadsheet which will delete all current
modules
(apart from the one containing itselr) and froms then import the
code
from
an
external file? In other words automate the task I am having to do.





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
Code Reqd. to generate Loading Slip Vikram Dhemare Excel Programming 3 September 1st 07 11:28 AM
loading vba code in excel from within C# Laura G.[_2_] Excel Programming 4 March 19th 07 01:02 PM
dynamically loading external macros, on the fly sp00nix[_25_] Excel Programming 2 March 19th 06 12:45 AM
External SQL Data not updating in spreadsheet when loading in OWC Chris Tromans Excel Programming 0 May 18th 05 06:16 PM
Addins not loading when opening from code Jack Excel Programming 3 February 15th 05 06:31 PM


All times are GMT +1. The time now is 06:57 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"