VBA code import - vba

I have a VBA project I am doing in excel. I will have many workbooks that will use the same code and I do not want to have to copy the code to all the workbooks if I make a change. Is there anyway to have the code in one central place and then have all the workbooks access that code?

Yes, you have two options
1) Copy and paste the code in the Personal workbook.
More details here
Topic: Deploy your Excel macros from a central file
Link: http://office.microsoft.com/en-us/excel-help/deploy-your-excel-macros-from-a-central-file-HA001087296.aspx
2) Create an Add-In
Mode details here
Topic: Creating An XLA Add-In For Excel
Link: http://www.cpearson.com/excel/createaddin.aspx
Note: You can create Add-In in VBA as well as Visual Studio. For COM Add-Ins (created using Visual Studio), please refer to this link.
Topic: Office Development with Visual Studio (VSTO)
Link: http://msdn.microsoft.com/en-us/office/hh133430
HTH
Sid

Related

How to create a task pane using C++/COM in MS Office?

I know Office add-ins can be created by
Office.js
VSTO
COM
I implemented an add-in before using VSTO, after searching for the information on how to do that on the Microsoft website, I get nothing. Is it lost how to create Office add-in using C++/COM technology? I know some software still use COM add-ins, such as Grammarly, TeamViewer, FoxitReader. But how to create a COM add-in? Some ideas? Thanks.

Excel Services Sharepoint 2010 removes macros from xlsm file

I am using Excel Services in Sharepoint 2010 to inject some data into an Excel xlsm file. This is working fine.
I know that macros will not run on the Sharepoint server, but I want users to be able to download the full workbook after the data injection and have the macros enabled in the full workbook. But, it seems that when Excel Services injects the data, the workbook is always saved with the macros stripped out of the file. Is there any way around this?
How does Excel Services "inject" data? Consider using a data connection in the Excel file instead.
To do that, create a view that shows the data you want and export to Excel. The file now has a data connection to the SharePoint list. You can configure the connection settings and use the data in the spreadsheet. You can hide the sheet with the SharePoint data if it messes up the workbook look.
Or, use the file "injected" with Excel Services as a source file and create a separate file that runs the VBA. Open the injected file and read its data with VBA.

Adding Outlook Object Library to Excel 2011 for Mac

I am trying to move a VBA macro code from Excel 2003 to Excel 2011.
The macro requires sending an Email from Outlook. However, when I went to Tool > References to add the Outlook Object Library, it does not show up in the List box.
How do I go about adding the reference in so i can access Outlook?
As of my knowledge Office Automation in the MAC world is somehow limited. Please see this discussion. Also this one in a Microsoft Forum..
You can add reference by using Browse option.
You just need to add reference to the file "MSOUTL.OLB"
In my system I have it in "C:\Program Files\Microsoft Office\Office12\MSOUTL.OLB" , In your system it could be in different folder.

creating an excel add-in

can someone please get me started on the following:
i would like to package an excel macro as an add-in to excel. the macro will reside on a central computer, where 10 other computers will connect to.
how do i create an add-in that will be constantly updated ?
According to this you can have an Add-In reside on a network share, so you wouldn't even need to bootstrap and update the code via code. Here's a quick rundown on how to create an Add-In.

Office 2007/2003 VSTO Shared Add-In Design Query

I am designing a shared add-in using VB.Net 2008 and VSTO that has to fire up when any MS Office App is started. It has to work for both 2002, 2003 and 2007 applications. I have managed to put together a working add-in that pops up a test message stating the version of Office and the Application name and tested this across all the apps ok.
The next part of the solution is to code the application specific code that needs to run for document auditing and corporate protective marking as well as, for example; in Excel checking that all the Add-Ins are linked to the Network Add-Ins folder.
My approach from now was going to be to late bind against the application object and set one of my typed (e.g. Excel) application object references which exist in the code to this object.
I'm still relativly new to VSTO so if I am doing something odd please can you let me know! :)
Ta.
I have completed this project and did it the way I specified using late bindig. It works lieka dream for all office apps both XP and 2007. :) I feel like I am announcing this to myself though as I didn't recieve a single answer or comment. Maybe you should have sexed up the title a bit Mas. Yeah maybe I should.