View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default insert vba code to new workbook

hi
i not sure what you mean by "main tool" so i feel hesitant about suppling an
specific code. but roughly you need help crating a blank workbook and adding
code to it??
to create a blank workbook use workbook.add
to add code to it, see this site
http://cpearson.com/excel/vbe.aspx

regards
FSt1

"Jive" wrote:

Hi

I have a large 5ish meg spreadsheet, into which project info is entered.
Once complete there is a function which opens a new workbook and then saves
it with the raw data in it, ie as a save file. which is much smaller.

I would like to add some code to the "Private Sub Workbook_Open()" section
of the save file so that if it is opened directly, and not through the main
tool as it is supposed to be, exports itself to the main tool.

I havent worked out the exact coding, although i know roughly what i need.

However, I need help on how to open a blank workbook and add the code to the
"Private Sub Workbook_Open()" section. I dont want to use a template if that
is possible.

Many Thanks