Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
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
Programatically adding macro to Excel - "ThisWorkbook" Aerojade Excel Discussion (Misc queries) 3 October 1st 08 12:53 PM
modify cell references in a formula programatically ralphehowardjr Excel Programming 2 December 20th 03 01:18 PM
Excel crashing when (programatically) adding past the 360th worksheet to a workbook Scott Lyon Excel Programming 2 August 14th 03 12:34 PM
Programatically adding worksheets to a spreadsheet Scott Lyon Excel Programming 4 August 8th 03 02:54 PM
Adding components to multipage programatically Nigel Brown[_2_] Excel Programming 0 August 4th 03 10:25 AM


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

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"