I have a workbook application for which I want to allow co-authoring, but it's not working after a simple share to an external company account, or when I logon to OneDrive with my own account on both machines. I continue to get the message when loading on the second machine, telling me my updates could not be merged and do I want to save a copy, or discard my changes. Choosing the discard option causes the first machine to produce the same error message and just go around in circles with each machine in turn.
My setup is a combination of 2 workbooks, one for the application and one for the data (date/time stamped records in a simple flat worksheet). Opening the primary workbook causes through Worbook_Open macros to open the second, data workbook. The primary workbook does have a pivot table referring to the data workbook (which is not refreshing at this time).
The primary workbook presents a userform with a list of activities and records the selected activity details to the data workbook, but again, not at the loading stage, only after the userform is activated later on. The data recording, when it happens, is driven by macros that use the command format Workbook(DataFilename).Worksheets("Records").Range(CurrentRow) = value, with additional similar commands including the ".Offset(0, col) to right to adjacent cells in the row. However, these macros don't execute until the userform is activated and actions taken.
I suspect it may be something that happens when I load the primary workbook, but no data is written to the data workbook at that stage. The only thing that does happen when I open the data workbook is that the Workbook_Open routine will reinitialize some named ranges in the data workbook - ultimately these named ranges are only used to build/refresh primary workbook pivot table - again not at load time. This is essential as the workbook does not keep the data in a table and must figure out where the last row of the data is, especially when more than one machine is updating that data adding new rows. In fact my intent is to use the Workbook_AfterRemoteChange() event routine to flag to the other machine that a change has been made. The current row number of the data is stored in a variable in memory, so a refresh of that value is essential along with an update of the last task selected on the other machine to automatically reflect on the userform, which would also be refreshed. That said, none of this happens are load time, only the redefinition of the named ranges on the data worksheet.
Just one more thing/complication: To avoid users trying to manually enter data or edit records etc. stored in the data workbook (requiring specific formats, formulas, etc. after I load the data workbook from the primary workbook, I also hide its window using Windows(DataFailename).visible = False. I have to say that anecdotally I have found that the AfterRemoteChange can (not always as per the above) fail to trigger and this may be if the data workbook is invisible in this way. I just don't know because the aforementioned problem is happening far too frequently to test this part.
I've setup a simple shared workbook with only the Workbook_AferRemoteChange() to produce a MsgBox whenever a change is made on the other machine and this works great, with no problems at all.
The workbooks and the macros would be too large and complex, not to mention the issue of intellectual property to share at this stage, but any ideas you may have through your own experiences would be great to hear about.
Many Thanks,
Max