From: mooresk257 on
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.Picture Is Nothing Then

How would I write this line to test if there IS an image?

Thanks!
From: Rick Rothstein on
Try this...

If Not Worksheets("Sheet1").OLEObjects("Image2").Object.Picture Is Nothing
Then

--
Rick (MVP - Excel)



"mooresk257" <mooresk257(a)discussions.microsoft.com> wrote in message
news:4B373C42-69F5-4812-8A83-A3885CA1BE9E(a)microsoft.com...
> 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.Picture Is Nothing
> Then
>
> How would I write this line to test if there IS an image?
>
> Thanks!

From: mooresk257 on
Thanks Rick - a double negative equals a positive - and it works perfectly!

"Rick Rothstein" wrote:

> Try this...
>
> If Not Worksheets("Sheet1").OLEObjects("Image2").Object.Picture Is Nothing
> Then
>
> --
> Rick (MVP - Excel)
>
>
>
> "mooresk257" <mooresk257(a)discussions.microsoft.com> wrote in message
> news:4B373C42-69F5-4812-8A83-A3885CA1BE9E(a)microsoft.com...
> > 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.Picture Is Nothing
> > Then
> >
> > How would I write this line to test if there IS an image?
> >
> > Thanks!
>
> .
>
 | 
Pages: 1
Prev: Macro to Find Column
Next: Table Name