Hello,

First post here... :-)

My problem is following:

1. I start with an Excel workbook (let's call it main.xlsm)
2. I execute a VB macro "Sub main()": this macro does a lot of things, but in the end I have a number of (created) tabs in main.xlsm. Each of these tabs needs to be send (e-mail) to a certain person. Each person will receive one tab (= an excel file with one tab). Tab "projectA" goes to "personA" ... No problem here.
3. That certain person should open his excel (which only contains 1 tab) and fill in a number of fields.
4. After having filled in these fields, the person should send the file back to me. To make this structural I want a button on the excel file that - when pressed - automatically sends the file back to me with a fixed subject filled in, to the right mail-address ...

The files send to the persons do not contain any of the VB code from my macro "Sub main()" (which is good). My macro"Sub main()" automatically creates a button on each excel before mailing it. But behind this button there should be a little piece of VB-code to mail .... the file back to me (step 4). So my macro "Sub main()" does an input of a .bas file into the excel file that is send, let's say it is Sub SendMail(). The button created will execute this macro Sub SendMail().

Now comes the problem. When my receivers push the button, for some reason it is searching for the macro Sub SendMail() in the original workbook main.xlsm or ... but not in the file itself...

I do not know if you understand my problem :-)


Another thing I was thinking was executing a macro before startup when my receivers open the file and this macro will create the button and link it to SendMail() included in the file. This should work, but I don't want to do "macro before startup" when not needed ..

Help ...

Thanks