Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to save watch list in Excel 2010 VBA ?

Posted on 2014-08-13
3
Medium Priority
?
1,397 Views
Last Modified: 2014-08-14
Hello,

I was hoping there was a way to either save or programmatically add variables to the watch list in Excel VBA ?

I just have a procedure with a fair few variables (like 25) and I don't want to add them everytime I open this file and continue programming and debugging it.

Any help appreciated.

Regards,
Craig
0
Comment
Question by:slobber72
3 Comments
 
LVL 23

Expert Comment

by:JSRWilson
ID: 40260764
The object model doesn't have any way (AFAIK) of addressing the Watch window so I think it is impossible to do what you need. Hope I'm wrong!
0
 
LVL 50

Accepted Solution

by:
Martin Liss earned 1500 total points
ID: 40260883
Unfortunately there's no way to do that with VBA while you are debugging Excel. Probably the best that you could do if the variables have global scope (or you change them so that they are global) would be to write a sub that contains a list of Debug.Print statements for each variable you are interested in. At that point you could simulate a "Watch Expression" watch by setting a breakpoint and calling that sub from the Immediate Window.

If you are interested here's a link to an article I wrote on debugging.
0
 

Author Closing Comment

by:slobber72
ID: 40262004
Thanks for the feedback. I think I will rethink how I use debug print for this particular instance.

Cheers
Craig
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question