Splitting code to modules ... HOW ?

I have build several Excel VBA applictions, but many of them use som
same code and functions. I like to put the code into ONE base module. 
How must I create the module, export it ? And how to refer to it in al
the programs I like to use the base module ??

Roel

--
Message posted from http://www.ExcelForum.com

0
12/16/2003 10:18:13 AM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
404 Views

Similar Articles

[PageSpeed] 7

Roel

If the macros are in several workbooks copy them into the 
same book and save this as Personal.xls The personal 
workbook may not be visible when you start Excel but the 
macros will be available to all workbooks.

Alteratively, save the macro as an addin 
e.g. "myFile.xla". AddIns have to be installed Tools, 
Addins Your file "myFile" will appear on the list. Click 
the checkmark to install the addin. The xls file will 
still exist and be available to edit or add new macros but 
you wil have to save the xla file as well.

Regards
Peter
>-----Original Message-----
>I have build several Excel VBA applictions, but many of 
them use some
>same code and functions. I like to put the code into ONE 
base module. 
>How must I create the module, export it ? And how to 
refer to it in all
>the programs I like to use the base module ??
>
>Roel.
>
>
>---
>Message posted from http://www.ExcelForum.com/
>
>.
>
0
12/16/2003 11:03:43 AM
Reply:

Similar Artilces:

MSIL code
Hi! I just wonder about this Reflector tool. If I made a dll in .NET can then a person that have this DLL look at all the source code by using the Reflector tool ? I mean can he/she recreate all the source code. If I instead have a DLL unmanaged code for example made in C++ is it here possible look at the source code by using some kind of tool. I mean something that remind of Reflector ? //Tony Since .NET programs and libraries are compiled to MSIL, basically yes. Anyone can use .NET Reflector to view your source code almost as you wrote it. You can use various tools (D...

code 643
I HAVE TRIED SEVERAL TIMES TO DOWNLOAD THIS SECURITY UPDATE SP1 AND I GET THIS ERROE CODE 643...PLEASE HELP JANA wrote: > I HAVE TRIED SEVERAL TIMES TO DOWNLOAD THIS SECURITY UPDATE SP1 AND > I GET THIS ERROE CODE 643...PLEASE HELP SP1 for...? -- Shenan Stanley MS-MVP -- How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html Same Issue - Error Code: 0x643 while trying to install: Microsoft .NET Framework 1.1 SP1 Security Update for Windows 2000 and Windows XP (KB979906) "Shenan Stanley" wrote: > JANA ...

Contacts code
Hello Folks Does anyone know where I can find some library files to create a system of users/contacts and groups to add the users to. Somewhat like in MS groups and users. I have been poking around for a few days trying to find some code that would do this. Dan ...

Colour coding data
Hi- I would like to be able to automatically colour code percentages into red, amber, green depending on the number. I know this can be done but cannot figure out how! Any help appreciated Use conditional formatting. See http://www.contextures.com/xlCondFormat01.html --- HTH Bob Phillips "Michelle" <Michelle@discussions.microsoft.com> wrote in message news:CD770409-882A-40E2-9D3D-DBAD19AD95D7@microsoft.com... > Hi- I would like to be able to automatically colour code percentages into > red, amber, green depending on the number. I know this can be ...

code for Location
We have more than one location that is entering data into a form. The 'yard' field is where the location would go. I can I code it to where the system knows where the person is entering information. Basically, I can I have Access recognize where the data entry clerk is an automatically have the 'yard' field filled? Why not use the local computer name to determine location? http://www.mvps.org/access/api/api0009.htm p-rat wrote: >We have more than one location that is entering data into a form. The >'yard' field is where the location would go. I can I code it to ...

MSCRMWorkflowService Error code 80048306
FAILED to start process 'A06FEC80-6C61-4DFF-8D26-BB629DC898BD' for object: (4406,{1BC85C28-B694-DA11-BFF6-0014C2613BB7}). Caller is 'SYSTEM'. Error code 80048306. Any ideas? -- Frederic Pieters CRM Consultant - www.traviata.be The description for this error code is "Not enough privilege to access the Microsoft CRM object or perform the requested operation.". So it looks like the user that tries to start the workflow doesn't have the privilege to start a bulkoperation. HTH, -- Jeffry van de Vuurst CWR Mobility www.cwrmobility.com -- "Frederic"...

Control Code to set a Date
My Combo Box [cbOwnerName] has a Row Source [qPayableTotalForPayment] which has 9 Columns in combo box the last Column being [My Date]MyDate: Format([MaxOfBillDate],"d-mmm-yy") I want to code my Button to Change the date in [tbStartDate] to the date im [cbOwnerName] once selected I click Button to give that date in [tbStartDate] Thanks for any help.........Bob Hi Bob, If I am understanding correctly this should solve your problem. "OnClick" event Sub Command1_Click() Dim x as string x = me.cbOwnerName.Column(8) me.tbStartDate = x End Sub HTH, Nick "Bob V&q...

coding a heads down data entry
I can't seem to get the right controls to do the following; keying in data one character "X" or Blank to auto advance to next element. The value of the "X" is 1 (One). The value of Blank being "0' (zero). There will be a lot of these one character fields. Not sure how to tell it "Text" when the value will 1 when an "X" is entered. Of course the enter key will advance leaving blank. I hope this isn't a stupid question. :) Izod If I understand you correctly you want the cursor to move from field to field without pres...

Is there somewhere to find the html code for my email?
I created an email using publisher and I would like to find the html code. Is there a way to do this? I am having problems sending this email to my group and would like the code to use in another email program - can anyone help - please!!! basic enough - just want to get the code and be able to copy it... can anyone help with that - I am really slow at this - I need help like yesterday! "ajkawinkelman" wrote: > I created an email using publisher and I would like to find the html code. > Is there a way to do this? I am having problems sending this email to my >...

Need code to detect grouped sheets
Hi, I'm writing a For Next procedure that would loop through a collection of password protected worksheets, uprotect each and do something. However, the code would fail if some worksheets are grouped. Please can someone provide me with the code needed to detect the existence of grouped worksheets and then ungroup them. I have failed to find anything that seems to work from the online help such as hasarray etc. Thanks Andy, Try something like If ActiveWindow.SelectedSheets.Count > 1 Then MsgBox "Grouped Sheets" Else MsgBox "No grouped sheets" End ...

Code Bloat/Growing Excel Files
I recently opend a 330kb file and made some changes and the file turned into a 9mb file. I did the following operations: 1. deleted 31 sheets and replaced them with 31 new ones 2. created some macros 3. deleted macros (the macro dialog box lists no macros). 4. saved the file. Any thing that could have caused this file to blow up like this? I'm running Excel97 on a ME machine ...

More efficient code for multiple If...End If statements
In the on current event of my form, I'm setting the Backstyle and Borderstyle of several controls based on the whether the control is null. For example: ' 0 = Transparent ' 1 = Normal If IsNull(Me.FirstName) Then Me.FirstName.BackStyle = 0 ' Transparent Me.FirstName.BorderStyle = 1 Else Me.FirstName.BackStyle = 1 ' Normal Me.FirstName.BorderStyle = 1 End If If IsNull(Me.LastName) Then Me.LastName.BackStyle = 0 ' Transparent Me.LastName.BorderStyle = 1 Else Me.LastName.BackStyle = 1 ' Normal Me.LastName.Border...

Lock first column and title row in Excel sheet by code
Hi all, my VB6 program creates every morning an Excel workbook with 1 sheet. The actual product and weight for 57 storage tanks is written into this sheet. During the day, if the product changes, a new line is added to the sheet. The next morning the final amount for each tank is written into a column, the workbook closed and a new workbook created for this day. That works great, but now the customer wants the title row and first column fixed (non-scrollable) by my program when it creates the sheet. I know he could easily do this manually, but... I searched but couldn't find ...

Automatically save web page's html source code
Hi, I'm trying to pull information on my fantasy football league directly from the Yahoo web page into Excel. I had a macro set up last year that did it with an Excel web query, but something's not working this time around. (It almost seems as if Yahoo has somehow completely disabled my ability to pull info from this web page into Excel or Word; not even copying and pasting by hand seems to work-- try it! http://football.fantasysports.yahoo.com/f1/show?page=roster&lid=188763&mid=5 ) Anyway, back to my real question. I figure if I can get ahold of the html source, then I can...

Have been using Payroll, adding HR module
We have been using Payroll for years, and now have added the HR module. Struggling a bit with the setup necessary for HR. Where do I find the steps necessary to update the HR module from Dynamics payroll? V10, SP3 All I have found is the Human Resources PDF which is more for brand new installs, really doesnt address the issues of already having data from Dynamics payroll. -- Doug Doug, When setting up HR/P there will be some pre-requisites. You will need to have certain payroll data in place (employees, etc) before you continue with the HR setup. You can still follow the man...

Form Code to append results from query to table
I have a button on a form that thru code will run a macro which will run a query. How do I get the results from that query to append to a table, all through vb code of my form? Thanks, Frank -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200705/1 "Frank via AccessMonster.com" <u7122@uwe> wrote in message news:7196adb2a8320@uwe... >I have a button on a form that thru code will run a macro which will run a > query. How do I get the results from that query to append to a table, all > through vb code of my fo...

only allow one enititly to execute code at a time
I have a function that MUST be executed on its own, i.e. there cannot be multiple calls to the function, when the function is executing, another call to it must wait for the 1st call to return first. (if that makes sence). I have tried to do this by placing a BOOL value that is set to true when the function is entered, and false when the function exits, and check ing the value before the calls, but some how, it is still allowing multiple instances of execution. Is there any other way to stop this? I have several threads that all call this function and sometimes they overlap causeing the pro...

Error code 0x8004210E
I recently upgraded motherboard and processor. When I reconfigured my e-mail account I get this error code , the text of the code indicates my mailbox on the server is locked. When I test e-mail settings I get a completed process on eveything except "log on to POP3 server". Any information will be greatly appreciated. I've been getting the same error code this morning. I sent two similar e-mails to the same person. The first one went through, but I can't get the second one to go through. I tried rebooting, changing the text of the e-mail, changing the name of the att...

Module Names
Is ther a way of giving modules their own descriptive names? Example: Instead of Module1, something like "Page Programs" Thanks in advance Vic Vic, You can rename modules by selecting the module in the Project Explorer (Ctrl+R) and then displaying the Properties window (F4) and changing the Name property. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com chip@cpearson.com "Vic" <anonymous@discussions.microsoft.com> wrote in message news:054c01c39351$1a579f90$a301280a@phx.gbl... > Is ther a way of givin...

can you rename a module?
like you do it in MS Access? thank you all In the VBA Editor, select the module in the Project Explorer (go to the View menu if this is not visible), and press F4 to bring up the properties window. Change the name there. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JOHN SMITH" <NEW> wrote in message news:e9%23zBWwLFHA.3336@TK2MSFTNGP09.phx.gbl... > like you do it in MS Access? > > thank you all > > ...

outlook caused an invalid page fault in module RPCRT4.DLL
These are the details of the error. This person can copy the contents of an email to Word and print. However, this message comes up everytime in Microsoft Outlook. OUTLOOK caused an invalid page fault in module RPCRT4.DLL at 0167:7fbd0894. Registers: EAX=0057031f CS=0167 EIP=7fbd0894 EFLGS=00010216 EBX=0056c1e4 SS=016f ESP=0056c004 EBP=0056c1f4 ECX=7713ee58 DS=016f ESI=00000484 FS=3bdf EDX=bff76855 ES=016f EDI=7713ef6e GS=0000 Bytes at CS:EIP: ff 30 ff 75 d4 8d 85 1c fe ff ff 50 e8 cb 0b 00 Stack dump: 0056c4fc 00000000 00000000 0056c14c 00000020 00000000 00000000 00000000 00000000 00000...

Attachment in Outlook 2000 split up and sent in various mails
Hi, Does anyone know the solution to this nifty problem? When I attach a file, say Word, to a mail and send it, the mail is always received as 5, 6, or 7 mails with distorted attachments. I have had a lot of complaints from recepiants. I am using Outlook 2000 on Windows XP with all Office and XP SPs as well as all security fixes from Windows Update and Office Update. I have been told it's related to a MIME/Exploit. If this is true, I do not have a fix for it. Can anyone help? Cheers Micheal ...

How to change a KMDF sample code to a VC6.0 project?
Hi, Is there any way to change a KMDF sample code to a VC6.0 project? I'm tryinh to change them to VC projects, like what I did to my old WDM drivers, but the system crashes at the call to WdfDriverCreate. I notices there is a "KMDF_VERSION_MAJOR=1" entry in the Source files of KMDF samples. Where should I add it into my VC project? I guess this is the reason why the system crashes at call to WdfDriverCreate. > Is there any way to change a KMDF sample code to a VC6.0 project? Building drivers with VC 6.0 is not supported. After all, it has old and obsole...

Split deposit in Money 2001
After being ticked off by Quicken for this and that, I saw that I had a 2001 Money OEM CD, which I installed, imported my Qucikent files and started using. But one thing puzzles me: often I collect a bunch of checks and deposit them in one bank transation. When I use the Split function for this, there is no payer column in the Split window. For each check I can enter a different category if I want, but I can't enter the payer. That means I can't search on payer for those checks. What gives? This seems like a strage design choice. P. It was the same in Quicken. Open a ne...

How do I split addresses(city, state,zip)?
I am trying to print labels but I have a spreadsheet with about 1200 addresses that are not separated. Makes sure all as many columns as you want to split this into are empty to the right select the column, then do data>text to columns and select commas as delimiter. -- Regards, Peo Sjoblom "newbie101" <newbie101@discussions.microsoft.com> wrote in message news:EDEF2C73-52B2-4031-A1E5-7CE26EF167EB@microsoft.com... >I am trying to print labels but I have a spreadsheet with about 1200 > addresses that are not separated. > ...