Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Insert module into workbook via automation?

Is it possible to insert a VBA code module into an existing Excel workbook
from Access 2000?

I need to add a button on certain worksheets (some worksheets, not all) that
will create charts. Unfortunately, I do not own the workbook and have to
append data and charts from a separate Access database. I want to add a
button and code for creation of more charts, but don't know if this is
possible. If I could insert a VBA module into the workbook, that might do
it. If someone could point me in the right direction on this that would be
great.

Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Insert module into workbook via automation?

Depending on how security is set up, you may be able to do it using techniques
at Chip Pearson's site:

http://www.cpearson.com/excel/vbe.htm

Or maybe you could just create the charts from Access--or create an addin that
has the code already in it and you could just load that addin and run that code.



deko wrote:

Is it possible to insert a VBA code module into an existing Excel workbook
from Access 2000?

I need to add a button on certain worksheets (some worksheets, not all) that
will create charts. Unfortunately, I do not own the workbook and have to
append data and charts from a separate Access database. I want to add a
button and code for creation of more charts, but don't know if this is
possible. If I could insert a VBA module into the workbook, that might do
it. If someone could point me in the right direction on this that would be
great.

Thanks in advance.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Insert module into workbook via automation?

Depending on how security is set up, you may be able to do it using
techniques
at Chip Pearson's site:

http://www.cpearson.com/excel/vbe.htm


I found this code on the site:

Sub AddModule()
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents.Add(vbext_ct_S tdModule)
VBComp.Name = "NewModule"
Application.Visible = True
End Sub

Looks like what I need - I'll give it a shot.

Or maybe you could just create the charts from Access--or create an addin

that
has the code already in it and you could just load that addin and run that

code.

Perhaps. I think what *should* be done is write it in C# with VSTO...

Thanks for the tip.


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
Workbook automation shaneh Excel Discussion (Misc queries) 1 July 8th 05 09:06 PM
Failure to open workbook via automation VanS[_2_] Excel Programming 0 February 4th 05 09:37 PM
Copy VBA Module and Form from Workbook to another workbook topaiva Excel Programming 1 November 25th 04 03:47 PM
How can I name the Module or class after I insert it into the Excel new.microsoft.com Excel Programming 2 January 17th 04 04:18 AM
How to insert Excel Worksheet Name using Automation in VB Dot Net?? Vanessa[_2_] Excel Programming 2 August 26th 03 03:57 PM


All times are GMT +1. The time now is 12:03 AM.

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"