473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to add a watch to VB expression

Hi,

I am using VB and excel and I would like to know how to add a watch to
an expression in VB for some lines of code. When I select a value in
excel and add a watch on a variable, I get Value: <Out of Context>.
Could somebody please explain how to add a watch expression properly
when i select a value in excel. Thanks in advance.

Swamy
May 31 '07 #1
2 7476
SammyB
807 Expert 512MB
Just a lot of guessing here, but probably you are using late binding in VB6, so VB does not know about any of the Excel objects. If this is the case, (1) add a Reference to Microsoft Excel xx Object Library, (2) put Option Explicit at the top of the module, (3) define all excel objects as Excel. (for example, Dim rng as Excel.Range)

If this is not the case, let us know what VB you are using (VBA, VB6, VB.Net) and how you are getting a reference to the Excel application. HTH --Sam
May 31 '07 #2
Killer42
8,435 Expert 8TB
Generally speaking, that "out of context" is usually not a problem. It just means you can't see it now. When execution is at the appropriate point, where the item exists, chances are you will be able to see it. Try putting a breakpoint at the line where you copied the reference from, to ensure that it's in context when you look.

Note, though, you may need to include the complete name in the watch, including the parent object.
Jun 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Premshree Pillai | last post by:
Hello, I recently posted a simple Python script--Watch That Post--that lets you watch a URL for any changes. I wrote it to watch posts on LiveJournal, but it can watch any URL. It's at...
0
by: Armin Zingler | last post by:
Hello, to reproduce the follwoing steps, "managed DirectX" must be installed. Despite, this is not a DirectX but an IDE problem (at least in VB.Net). As nobody answered in m.p.vsnet.ide and...
3
by: jason | last post by:
Does anyone have any ideas on a PAGE WATCH tool or an application that allows a user to be notified when page changes automatically by email. My immediate thoughts would be to use the FSO object...
2
by: Peter Steele | last post by:
Say I have a managed C++ app with some code that looks something like this: void MyMethod() { struct Point { int x, y; }; Point* p = new Point; p.x = 1; p.y = 2;
7
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. ...
6
by: Tau | last post by:
look my simple code below(vc8): double ends; ends=8.3; when i debug it, the variable ends cannot be displayed in the watch window. it just said "error: index '0' out of bound for...
2
by: Juliano.net | last post by:
How can I detect when a TAG is included dinamically to my page to do some actions using that TAG?
0
by: Ajit Goel | last post by:
Hi; My project file property is set to use "Visual Studio Development Server". I am able to debug and see the corresponding values when I mouseover but as soon as I change to the project file...
8
by: Greg | last post by:
Dear all, I've trouble with debugging a huge programm. I want to look into the properties of an object when I am at a breakpoint. But in the watch window he tell's me that the object is "out of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.