Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
i have created a addin through which i can set the password and does
couple of other things as well . my need is i need to embed that code on the report on which i use this addin . say there is a report callled test.xls when i use my addin on this report and send it accross the client i need my code to get copied in the report test.xls .... since i am using this addin on couple of reports i cannot manually copy paste the code ... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
The easiest method is to create a template workbook with the macro in the template. Then make a copy of the template when you start your macro. If code is located on the VBA sheet (not module) if you copy the sheet the code also gets copies. In VBa if you copy a sheet and do not use Affter or Before it automatically creates a new workbook with only one sheet. Another method is to write a macro that saves the VBA code to a BAS file and then read the BAS file into the 2nd workbook. Chip Pearson has good instruction on doing this at his website 'Programming In The VBA Editor' (http://www.cpearson.com/excel/vbe.aspx) Read the two bullets at the top of the webpage espcially the one below. •Next, you need to enable programmatic access to the VBA Project. In Excel 2003 and earlier, go the Tools menu (in Excel, not in the VBA editor), choose Macros and then the Security item. In that dialog, click on the Trusted Publishers tab and check the Trust access to the Visual Basic Project setting. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=175507 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
joel wrote:
Another method is to write a macro that saves the VBA code to a BAS file and then read the BAS file into the 2nd workbook. Chip Pearson has good instruction on doing this at his website 'Programming In The VBA Editor' (http://www.cpearson.com/excel/vbe.aspx) Best web page ever! Thanks. Phil Hibbs. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
Phil: Did you see the rest of Chip's website 'CPearson.com Topic Index' (http://www.cpearson.com/excel/topic.aspx) -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=175507 Microsoft Office Help |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
Thanks. Cordially, Chip Pearson Microsoft MVP 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com [email on web site] On Tue, 2 Feb 2010 06:46:06 -0800 (PST), Phil Hibbs wrote: joel wrote: Another method is to write a macro that saves the VBA code to a BAS file and then read the BAS file into the 2nd workbook. Chip Pearson has good instruction on doing this at his website 'Programming In The VBA Editor' (http://www.cpearson.com/excel/vbe.aspx) Best web page ever! Thanks. Phil Hibbs. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
how can we embed the code to the excel workbook from addin
joel wrote:
Phil: Did you see the rest of Chip's website 'CPearson.com Topic Index' (http://www.cpearson.com/excel/topic.aspx) OK, that's this lifetime filled up with things to read. Phil. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Embed powerpoint slideshow into excel workbook | Excel Discussion (Misc queries) | |||
Running an Excel AddIn from Access in Current WorkBook....Help!!!! | Excel Programming | |||
Use AddIn to Open an addtional Excel Workbook | Excel Programming | |||
VB addin excel can't see any workbook | Excel Programming | |||
how do i embed a file in a workbook | Excel Discussion (Misc queries) |