Reacting to Workbook.BeforeSave event from an excel add-in

TemiU

Board Regular
Joined
Dec 11, 2014
Messages
52
I have just installed the Dropbox add-in for Office 2016 (365). This add-in allows the user to see the Dropbox icon/ folder in the browse (left-hand) menu of the File -> Save option from any Office application.
We have a BeforeSave event firing on an Excel application. However, if the user chooses the Dropbox folder from the browse menu, the BeforeSave event does not fire.
Does anyone know of a work-around for this?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I'm unfamiliar with the addin and with how Dropbox interacts with Workbooks. You might try the Workbook_Sync or Workbook_BeforeXmlExport and see if those trigger.

If you can figure out how to programmatically run that addin feature, you can create a separate button that performs the BeforeSave code and then call the Dropbox program feature. If it's a VSTO addin without any extensibility, this may not be an option (look for a Dropbox library reference in the VB Editor).
 
Upvote 0
Thanks, AFPathFinder.

Our software is an application which we market, so we have no way of ensuring that our clients who use the Dropbox add-in use a work-around instead. If we did, we could just tell them not to use it in the first place! (One of the things our BeforeSave does is prevent users from saving in any format other than .xlsm, to avoid losing all of the macros.)

As such, even though there does seem to be some sort of Dropbox library (though I am not sure if it is for this add-in or for something else), it would do us no good. If we were to include the library, and then a client who does not have Dropbox (as most likely don't) opened the software, they would get a missing library or reference message.

The best we could come up with so far is a warning message in the AfterSave saying that they messed up and need to contact us.
 
Upvote 0
I don't think I have a surefire solution for the issue. Do you know if the Dropbox addin gives the option to save in a different format? Does it use the same SaveAs dialog box?

I think you can programmatically check for the Dropbox reference tied to another event like Workbook_Open to know if the possibility exists. I don't believe that would trigger the compile warning about missing references. That would at least ID the issue, but as far as stopping it, I couldn't say.
 
Upvote 0
The Dropbox add-in does give the option to save in a different format - that is the problem! It seems to be using the same dialog box, too, but not triggering the BeforeSave.

Thanks for your help, in any case!
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,869
Members
449,054
Latest member
juliecooper255

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top