excel - Is there a way to put a breakpoint when my active window changes? -


is there way put breakpoint on activewindow.change ? have macro run in new, unsaved excel file, supposed open csv file, save as, process it, , keep in focus. instead of that, when macro done selects empty new file unsaved, , puts csv in background. happens though use code below, before end sub:

wkb1.activate wkb1.sheets(1).activate wkb1.sheets(1).range("a1").select 

the thing 3 rows of code above set focus correctly, @ end sub switches unsaved file.

i thinking if can set breakpoint whenever active window name changes, can catch when happens, because macro i'm working huge, , can't find bug manually.

kind regards, daniel

the fix quite stupid, fixed issue creating new ribbon tab , run macro ribbon instead of running vba. removed , activate o select commands. macro behaving same, after removed activate , select commands, thing fixed running new menu.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -