Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing object value
I am working on setting up some code to test whether an image is loaded in an
image box: I use this to test to see if there is no image loaded: If Worksheets("Sheet1").OLEObjects("Image2").Object.P icture Is Nothing Then How would I write this line to test if there IS an image? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing object value
Try this...
If Not Worksheets("Sheet1").OLEObjects("Image2").Object.P icture Is Nothing Then -- Rick (MVP - Excel) "mooresk257" wrote in message ... I am working on setting up some code to test whether an image is loaded in an image box: I use this to test to see if there is no image loaded: If Worksheets("Sheet1").OLEObjects("Image2").Object.P icture Is Nothing Then How would I write this line to test if there IS an image? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing object value
Thanks Rick - a double negative equals a positive - and it works perfectly!
"Rick Rothstein" wrote: Try this... If Not Worksheets("Sheet1").OLEObjects("Image2").Object.P icture Is Nothing Then -- Rick (MVP - Excel) "mooresk257" wrote in message ... I am working on setting up some code to test whether an image is loaded in an image box: I use this to test to see if there is no image loaded: If Worksheets("Sheet1").OLEObjects("Image2").Object.P icture Is Nothing Then How would I write this line to test if there IS an image? Thanks! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Object Library invalid or contains references to object defintions | Excel Programming | |||
Can I get a chart object (excel.ChartObject) from OLE_chart.object | Excel Programming | |||
Testing an object varible for Nothing | Excel Programming | |||
Option button object proeprties or object not found in vba | Excel Programming | |||
Confusion about how the Window object fits into the Excel object model | Excel Programming |