Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Solved] Script only works on active excel sheet


  • Please log in to reply
16 replies to this topic
a4u
  • Guests
  • Last active:
  • Joined: --

Yes that does solve the issue but i'm against using anything that I don't understand.

Actually, I know what you mean. However, Sean originally wrote the ComObjActive function (which, btw, accesses the first object registered on the ROT - which may not be the last Active Excel Window), and he also wrote Acc_ObjectFromWindow. The example I gave you simply accesses the Window Object from the Control HWND you provide. This is the method I would suggest since Excel can have several processes (application objects) running at once, and some may be hidden.

Mickers
  • Members
  • 1239 posts
  • Last active: Sep 25 2015 03:03 PM
  • Joined: 11 Oct 2010
Well that makes much more sense. Thank you for explaining that as I know for a fact with these old computers we have ann issue with "ghost" Excel books. I'll create a version that uses the functions you showed me and see if I still have any issues when swapping between desktops. Much love! :D