Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Auto insert a vb module to a new workbook -riv

Hi all me again lol

im looking everywhere for this but cant find it anywhere so was wondering if
it was possible.

i have a workbook that gets used every week when im done filling in
information i have a macro that copies the first three worksheets puts them
into a new workbook then attaches the new workbook onto an email this is fine
it works perfectly.

however im trying to create an auto open for the new workbook i tried
installing the auto open on the worksheet itself but this does not work was
wondering if i could auto install a module from the folder location and then
save the workbook.

is this possible?

rivers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Auto insert a vb module to a new workbook -riv

You may be able to find something here

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

--
HTH,
Barb Reinhardt



"Rivers" wrote:

Hi all me again lol

im looking everywhere for this but cant find it anywhere so was wondering if
it was possible.

i have a workbook that gets used every week when im done filling in
information i have a macro that copies the first three worksheets puts them
into a new workbook then attaches the new workbook onto an email this is fine
it works perfectly.

however im trying to create an auto open for the new workbook i tried
installing the auto open on the worksheet itself but this does not work was
wondering if i could auto install a module from the folder location and then
save the workbook.

is this possible?

rivers

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto insert a vb module to a new workbook -riv

You could create a template workbook that already has that auto_open procedure
in it--Keep a single sheet with a unique name so you can delete that sheet
before you send.

Then use this template to create a new workbook
Copy the 3 sheets to the new workbook
delete the single sheet
save and send the new workbook.

Dim NewWkbk as workbook
dim actwkbk as workbook
set actwkbk = activeworkbook
set newwkbk = workbooks.add(template:="C:\yourpath\newbook.xlt")

actwkbk.worksheets(array("sheet1","sheet2","sheet3 ").copy _
after:=newwkbk.worksheets(1)

newwkbk.worksheets("deletemelater").delete

newwkbk.saveas ....

=====
Untested, uncompiled. Watch for typos.

And one of the nice things about using the template is that you can protect the
project that contains that auto_open procedure (if that's important). And you
don't have to worry about any security settings that would stop you from using
code to make changes to code.



Rivers wrote:

Hi all me again lol

im looking everywhere for this but cant find it anywhere so was wondering if
it was possible.

i have a workbook that gets used every week when im done filling in
information i have a macro that copies the first three worksheets puts them
into a new workbook then attaches the new workbook onto an email this is fine
it works perfectly.

however im trying to create an auto open for the new workbook i tried
installing the auto open on the worksheet itself but this does not work was
wondering if i could auto install a module from the folder location and then
save the workbook.

is this possible?

rivers


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Auto insert a vb module to a new workbook -riv

THANK YOU but have decided due to the antivirus software and having to
recreate a massive program to use the template version i going to have to
carry on looking

i wasnt looking for the VB editor to write vb i just wanted the editor to
insert a module i had saved in the folder as a .baa file

any further ideas any one?

ps thanks you dave and barb knowing that bit of info i will definatly use in
future packs.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Auto insert a vb module to a new workbook -riv

sorry not .baa file .bas file

"Rivers" wrote:
i wasnt looking for the VB editor to write vb i just wanted the editor to
insert a module i had saved in the folder as a .baa file




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto insert a vb module to a new workbook -riv

I don't understand what any antivirus software would do to prevent you from
using a template.

Start a new workbook
rename the first worksheet and delete all the others
import this .bas file into the workbook's project
save this file as a template and you're done.

Or you could look at the link that Barb suggested and review the code labeled:
Copy A Module From One Project To Another

Rivers wrote:

THANK YOU but have decided due to the antivirus software and having to
recreate a massive program to use the template version i going to have to
carry on looking

i wasnt looking for the VB editor to write vb i just wanted the editor to
insert a module i had saved in the folder as a .baa file

any further ideas any one?

ps thanks you dave and barb knowing that bit of info i will definatly use in
future packs.


--

Dave Peterson
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
How can I have data auto insert into another pg in workbook? beaker0103 Excel Worksheet Functions 0 August 17th 06 04:53 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Insert module into workbook via automation? deko[_2_] Excel Programming 2 March 7th 05 08:00 PM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


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