Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Library invalid or contains references to object defintions John Excel Programming 1 July 24th 09 11:00 AM
Can I get a chart object (excel.ChartObject) from OLE_chart.object chris Excel Programming 4 December 16th 08 08:36 AM
Testing an object varible for Nothing Conan Kelly Excel Programming 5 August 7th 06 07:12 PM
Option button object proeprties or object not found in vba Pete Straman S via OfficeKB.com Excel Programming 0 August 31st 05 05:49 PM
Confusion about how the Window object fits into the Excel object model Josh Sale Excel Programming 11 April 15th 05 06:08 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"