Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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
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
Embed powerpoint slideshow into excel workbook rm84 Excel Discussion (Misc queries) 5 September 29th 09 10:52 PM
Running an Excel AddIn from Access in Current WorkBook....Help!!!! Tirelle Excel Programming 5 January 2nd 08 10:19 AM
Use AddIn to Open an addtional Excel Workbook John Cole, Jr. Excel Programming 1 August 13th 07 09:08 AM
VB addin excel can't see any workbook [email protected] Excel Programming 0 July 26th 06 03:44 PM
how do i embed a file in a workbook IAN C Excel Discussion (Misc queries) 2 April 28th 06 04:27 PM


All times are GMT +1. The time now is 08:48 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"