Click here to Skip to main content
15,921,062 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generaladding multiple textboxes at runtime Pin
craigmg787-Dec-07 10:32
craigmg787-Dec-07 10:32 
GeneralRe: adding multiple textboxes at runtime Pin
Christian Graus7-Dec-07 10:51
protectorChristian Graus7-Dec-07 10:51 
GeneralRe: adding multiple textboxes at runtime Pin
craigmg787-Dec-07 10:57
craigmg787-Dec-07 10:57 
GeneralRe: adding multiple textboxes at runtime Pin
nlarson117-Dec-07 10:52
nlarson117-Dec-07 10:52 
QuestionWhat is the best way to write the same VBA code for multiple Excel workbooks? [modified] Pin
redjoy7-Dec-07 9:19
redjoy7-Dec-07 9:19 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
Dave Kreskowiak8-Dec-07 17:04
mveDave Kreskowiak8-Dec-07 17:04 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? [modified] Pin
redjoy9-Dec-07 10:26
redjoy9-Dec-07 10:26 
GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
Dave Kreskowiak10-Dec-07 2:02
mveDave Kreskowiak10-Dec-07 2:02 
redjoy wrote:
The code does not need to work with data from other files. All the data needed is already contained within each workbook.
...
The format of each Workbook is the same. The code for each workbook is identical.


You're missing the point. The code (all 15 copies of it) DOES work with the data from every workbook. You're trying to avoid maintaining 15 copies of the code, so you need to have only a single copy of it somewhere. That single copy needs to get at the data for all 15 workbooks.

But, as you post some of the code, you have a problem. You're handling the events fired by changes in the worksheet. This makes it very difficult to seperate the code from the data, and hence keep only a single copy of the code outside of the workbooks.


redjoy wrote:
I was not able to find out any thing about add-ins using the VBA behind a worksheet.


That's because you can't. An Add-In is written in C++, C#, VB.NET, or something else that generates "real code" and is completely seperate from any workbooks.


I'd say your best bet is to write this as an Add-In to Excel.



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007



GeneralRe: What is the best way to write the same VBA code for multiple Excel workbooks? Pin
hwahlberg10-Feb-08 10:24
hwahlberg10-Feb-08 10:24 
GeneralCreate log file Pin
nishkarsh_k7-Dec-07 6:38
nishkarsh_k7-Dec-07 6:38 
GeneralRe: Create log file Pin
nlarson117-Dec-07 8:33
nlarson117-Dec-07 8:33 
GeneralRe: Create log file Pin
Mark Churchill7-Dec-07 14:44
Mark Churchill7-Dec-07 14:44 
GeneralSigning a User Control Pin
Andy Dale7-Dec-07 3:39
Andy Dale7-Dec-07 3:39 
GeneralPassword Problem Pin
Dave McCool7-Dec-07 2:21
Dave McCool7-Dec-07 2:21 
GeneralRe: Password Problem Pin
Christian Graus7-Dec-07 10:53
protectorChristian Graus7-Dec-07 10:53 
GeneralRe: Password Problem Pin
Dave McCool8-Dec-07 1:37
Dave McCool8-Dec-07 1:37 
GeneralEnding a VB Program Pin
Dreamer20077-Dec-07 1:11
Dreamer20077-Dec-07 1:11 
GeneralRe: Ending a VB Program Pin
CPallini7-Dec-07 2:19
mveCPallini7-Dec-07 2:19 
QuestionURGENT: Export to excel and special characters Pin
buzzvishwanath6-Dec-07 22:47
buzzvishwanath6-Dec-07 22:47 
GeneralRe: URGENT: Export to excel and special characters Pin
coolestCoder7-Dec-07 4:40
coolestCoder7-Dec-07 4:40 
GeneralRe: URGENT: Export to excel and special characters Pin
leckey7-Dec-07 8:03
leckey7-Dec-07 8:03 
GeneralRe: URGENT: Export to excel and special characters Pin
Paul Conrad7-Dec-07 14:43
professionalPaul Conrad7-Dec-07 14:43 
GeneralUser defined DataTypes Pin
gilchinger6-Dec-07 21:21
gilchinger6-Dec-07 21:21 
GeneralRe: User defined DataTypes Pin
gilchinger7-Dec-07 1:14
gilchinger7-Dec-07 1:14 
QuestionDLL & XML Resource.... Pin
Dhanraj6-Dec-07 20:03
Dhanraj6-Dec-07 20:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.