hatman
Well-known Member
- Joined
- Apr 8, 2005
- Messages
- 2,664
So I inheritted a workbook that performs transactions with a central Access Database. The workbook is readonly, and is open at any given time on upwards or 50 computers, all performing read/write operations on teh database. I repaired all of technical issues with teh traffic, timing, database loading, etc.
But I still have issues with the architecture. 1) The original designer placed this workbook in the same place as the database... people open the database by mistake all the time. 2) All of the database write actions are keyed froom the Chenge event of the worksheet... the worksheet is basically a "report" of teh database contents, and when the user changes a value, it writes to the database through the worksheet_change event. 3) Users constantly save copies of the workbook to their desktops... thus excluding themselves from the update loop. 4)users get very confused regarding where the file is located, what file to open, what shortcut to use, blah blah blah.
What I want to do is to re-distribute this as an addin, run from the network drive. I have built code that will do teh install automatically, with several distribution methods. That part is child's play. I have been playing with isolated test workbooks, and have worked out the whole Class Module layout so when a user hits a toolbar button, a new workbook is created, populated with data, and all of the events get trapped in the addin class modules for proper code response. I have built it so that if Excel loses it's staate (all globals get cleared) it gets detected before toolbar sub-routines are executed, and the whole global structure gets re-built, recapturing the existing workbook. But where I hung up is how to handle a user changing a vlaue in teh worksheet of the workbook after a state loss has occured. The event won;t get trapped in the class module of the addin, because the global will have been lost... the user will move along fat dumb and happy assuming that the data wrote to teh database, when in fact it didn;t.
I can't see a way to re-establish the global structure and reconnect to the workbook in any automated way. I would even settle for some way to warn the user that the state has been lost in some useful message that instructs them to press a particular toolbar button to re-create the globals before proceeding. I have considered some sort of polling routine using OnTime to constantly verify that the global objects still exist, and rebuild them if they suddenly disappear... but that seems excessively intensive and probably prone to breakage in some way. I can see a different architecture where the user selects a record, then presses a button to edit it in a dialog bax... but I don;t even want to try to fight the pushback from the user community on that approach.
I think I have hit a major roadblock to prevent me from making this an addin. Does anyone have any advice to overcome this one? I suppose I can leave this as a standard xlsm... but I would like to find a way to make this more professional...
But I still have issues with the architecture. 1) The original designer placed this workbook in the same place as the database... people open the database by mistake all the time. 2) All of the database write actions are keyed froom the Chenge event of the worksheet... the worksheet is basically a "report" of teh database contents, and when the user changes a value, it writes to the database through the worksheet_change event. 3) Users constantly save copies of the workbook to their desktops... thus excluding themselves from the update loop. 4)users get very confused regarding where the file is located, what file to open, what shortcut to use, blah blah blah.
What I want to do is to re-distribute this as an addin, run from the network drive. I have built code that will do teh install automatically, with several distribution methods. That part is child's play. I have been playing with isolated test workbooks, and have worked out the whole Class Module layout so when a user hits a toolbar button, a new workbook is created, populated with data, and all of the events get trapped in the addin class modules for proper code response. I have built it so that if Excel loses it's staate (all globals get cleared) it gets detected before toolbar sub-routines are executed, and the whole global structure gets re-built, recapturing the existing workbook. But where I hung up is how to handle a user changing a vlaue in teh worksheet of the workbook after a state loss has occured. The event won;t get trapped in the class module of the addin, because the global will have been lost... the user will move along fat dumb and happy assuming that the data wrote to teh database, when in fact it didn;t.
I can't see a way to re-establish the global structure and reconnect to the workbook in any automated way. I would even settle for some way to warn the user that the state has been lost in some useful message that instructs them to press a particular toolbar button to re-create the globals before proceeding. I have considered some sort of polling routine using OnTime to constantly verify that the global objects still exist, and rebuild them if they suddenly disappear... but that seems excessively intensive and probably prone to breakage in some way. I can see a different architecture where the user selects a record, then presses a button to edit it in a dialog bax... but I don;t even want to try to fight the pushback from the user community on that approach.
I think I have hit a major roadblock to prevent me from making this an addin. Does anyone have any advice to overcome this one? I suppose I can leave this as a standard xlsm... but I would like to find a way to make this more professional...