Thanks for your reply GS.
I think I'm back on track now.
I had a situation where windows was telling me I couldn't overwrite the .xla
on the server because the file was in use. It led me to believe the file was
deemed "in use" whenever a user was running Excel with the addin installed.
I can't reproduce the situation now so I'm happy again !
Regards,
Vic Eldridge
Hi Vic,
I'm glad I could help!
As I said, it depends how the file is opened. There's nothing to prevent
users from opening an .xla as a workbook. This will cause it to be treated as
any other open file, regardless of whether its "IsAddin" is set to TRUE or
FALSE. Thus, if you see the warning message again, you'll know someone's
opened it that way.
It might help if I clarify what's happening here:
Excel handles Add-ins via the Add-ins Manager. This works similar to how
.xlt's are handled when the Add-in is opened. The original file is not "in
use" so you can modify it however you want while it's open, just as you can a
.xlt file while the 'copy' is open.
For example, say you're using a sheet or book created from a template and
find you need to change the template. You can open it, modify it, save it,
and close it without any objections from Excel or Windows. The same holds
true for add-ins, but not if they're opened like a workbook. Opening an
add-in like a workbook is like having the .xlt file open. You can't open a
second instance of any file in Excel, so this applies to add-ins. To modify
an add-in, you need access to its instance via the VBE. Saving it overwrites
the original file, but it's not held "in use" afterward. (-Obviously, you
can't access it while it's being overwritten)
If your user opened it like a workbook, you can't open it that way without
getting the "in use, read only" message. (-just another confirmation of how
people might be using the file)
I avoid all this nonsense by using a "frontloader" add-in that places a
menuitem on the Excel menubar, for the user to open and close the add-in.
This way I can deal with version checks, registration and licensing, trial
version validation, and et cedera before the add-in even starts. But the main
advantage is to provide the use with correct access to the add-in via a mouse
click. You can even hide it in the normal Open dialog if you give it a
non-Excel file extension. Of course, it can be found by changing the 'Show
Files of Type' to "All Files...", but most average users wouldn't think that
it doesn't have an Excel file extension.
Regards,
GS