Using Excel 2007, Win7 (but addin will be used on XP/2003 machines as well).
I keep running into an issue with Excel thinking that the ActiveWorkbook is the one my add-in is in. I NEVER want the add-in to be the activeworkbook. It seems to be intermittent behavior, too. Sometimes the code runs fine. Sometimes it errors because the add-in has become the activeworkbook. In all cases, I have an excel workbook open (besides the "invisible" addin workbook).
I googled quite a bit on this, came up with nothing.
Is there a good way to make sure the add-in is not being considered the activeworkbook? I'd like to account for:
1) Make sure user has SOME workbook open (e.g. not just the Excel app w/ no workbook)
2) If a workbook (or multiple workbooks) IS open, make sure ActiveWorkbook is not the active one. Is there a way to set active to the workbook that was most recently active? For instance, the one most recentluy opened, or the one most recently clicked on? I dont' want to activate a RANDOM one, you know?
My preference would be to just make sure the addin is not the activeworkbook; if I can do that without checking other ones being open, etc., I'm very fine with that.
Thanks for any help with this.
Bookmarks