Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
default references or adding programatically
Hi,
Not sure i get it. -You have a base workbook containing the code. From there you create other report books. -If so, do you really need code in the report books? (you probably have your reasons, but just asking) Basically, wil the report books have to perform programmatic actions later when they will be open as stand-alone? -To add references: in your base book, add a ref to the Microsoft Visual Basic for Application Extensibility which gives you access to the vbide model. then use the VBProject.References collection and its AddFromFile or AddFromGuid method on the report book to add the scripting library. (not sure exactly of the syntax, check the online help once the vbide lib is loaded) I hope this helps Sebastien "barnabel" wrote: OK, I know this is strange and I hope somebody can help. I do some pretty extensive things in Excel. In a general sense, I have a book that contains a "parameter" sheet and 2 modules. One module contains all the code for pulling data from a database and sometimes building a pivot table from it. The second module does a lot of formatting including adding formulas for totaling. The code for pulling the data creates a new workbook that the data is loaded into and the formatting module is copied to. My problem is that in a few cases the formatting and totalling process requires objects that are not in the standard set of references for an Excel book. (particularly MS Scripting) I know that I can get around the problem by changing my code to use type object and createObject rather than the real object type but this is clunky and slower. Is there any way to change the default list of references when a new workbook is created or alter a workbook other than the active one to set the references? Thanks for any help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programatically adding macro to Excel - "ThisWorkbook" | Excel Discussion (Misc queries) | |||
modify cell references in a formula programatically | Excel Programming | |||
Excel crashing when (programatically) adding past the 360th worksheet to a workbook | Excel Programming | |||
Programatically adding worksheets to a spreadsheet | Excel Programming | |||
Adding components to multipage programatically | Excel Programming |