ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Embedding VBA in New Workbook (https://www.excelbanter.com/excel-programming/321328-embedding-vba-new-workbook.html)

Patrick

Embedding VBA in New Workbook
 
I am writing code behind an Excel workbook that will interface with my
mainframe, extract purchase order data, write it to the sheet, categorize it
by vendor, then write each vendor's data to a seperate workbook. Each new
workbook then gets sent to the specific vendor for updates to be made, is
sent back to me, and then populates the updated information back into the
mainframe.
My problem is that once I create each seperate vendor workbook I need to
embed the VBA code that allows that data to be sent back up into my
mainframe. Is there a way that I can have my main spreadsheet embed the
needed code (and command buttons) in the new sheets at the time they are
created?
Thanks!
patrick

Bernie Deitrick

Embedding VBA in New Workbook
 
Patrick,

Use a template file for the "seperate workbook" that you open, modify by
adding data, and then save as under an apprpriate name. The file should
have all the code, buttons, etc., and will greatly simplify the task.

HTH,
Bernie
MS Excel MVP

"Patrick" wrote in message
...
I am writing code behind an Excel workbook that will interface with my
mainframe, extract purchase order data, write it to the sheet, categorize

it
by vendor, then write each vendor's data to a seperate workbook. Each new
workbook then gets sent to the specific vendor for updates to be made, is
sent back to me, and then populates the updated information back into the
mainframe.
My problem is that once I create each seperate vendor workbook I need to
embed the VBA code that allows that data to be sent back up into my
mainframe. Is there a way that I can have my main spreadsheet embed the
needed code (and command buttons) in the new sheets at the time they are
created?
Thanks!
patrick




Patrick

Embedding VBA in New Workbook
 
Yes, I held that option as a fall-back plan. I was hoping to learn a new
trick today :) ...always looking to increase my skill set. Thanks for the
reply, Bernie!

"Bernie Deitrick" wrote:

Patrick,

Use a template file for the "seperate workbook" that you open, modify by
adding data, and then save as under an apprpriate name. The file should
have all the code, buttons, etc., and will greatly simplify the task.

HTH,
Bernie
MS Excel MVP



Tom Ogilvy

Embedding VBA in New Workbook
 
http://www.cpearson.com/excel/vbe.htm
Chip Pearson's page on working with code using code.
--
Regards,
Tom Ogilvy

"Patrick" wrote in message
...
Yes, I held that option as a fall-back plan. I was hoping to learn a new
trick today :) ...always looking to increase my skill set. Thanks for

the
reply, Bernie!

"Bernie Deitrick" wrote:

Patrick,

Use a template file for the "seperate workbook" that you open, modify by
adding data, and then save as under an apprpriate name. The file should
have all the code, buttons, etc., and will greatly simplify the task.

HTH,
Bernie
MS Excel MVP






All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com