Hello. I have created a custom class cTaskPlan in my "TaskPlan" workbook that represents all the data in the workbook. I have a function FillTaskPlan() that creates a new instance of cTaskPlan and populates it with data from the sheet and returns a cTaskPlan object. I'm trying to send out one of these "TaskPlan" workbooks to each team member. Each week I will get the workbook backs. I then want to have a "TaskPlan Aggregator" workbook that i can open, run a macro, it opens each "TaskPlan" workbook and pulls in a populated cTaskPlan object into a collection. Then in the Aggregator file I'll have a collection of all the cTaskPlan objects I can loop through and work with them. I think I have the "TaskPlan" workbook setup correct. From the aggregator, I can open the "TaskPlan" workbook, call the FillTaskPlan() function returning the cTaskPlan object to an object variable. Then I add that to a collection. The problem is, when i close the "TasKPlan" workbook to move on to the next one, the TaskPlan object that was full of data is emptied out. It's as if the object is a reference to an object in the "TaskPlan" workbook and is cleared out upon closing the workbook. Any help would be greatly appreciated. Thanks (Excel 2007)
This is the FillTaskPlan() code in the "TaskPlan" workbook
This is the code from the "TaskAggregator" workbook. Everything works well. Upon wbTarget.Close... the TaskPlan object is cleared out. I need it to persist.![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Bookmarks