ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting a picture/drawing (https://www.excelbanter.com/excel-programming/341906-inserting-picture-drawing.html)

Robert Dieckmann

Inserting a picture/drawing
 
I am trying to set up a spreadsheet where it will embed one of two drawings
(which I copy-clipped from AutoCAD) based on a parameter within the
worksheet. I thought when I created the second drawing it would
automatically give a different formula, but both of them say:
=EMBED("AutoCAD.Drawing.16","").

In essence I'm looking for a formula such as this:
=If(A1="x",EMBED("AutoCAD.Drawing.16",""),EMBED("A utoCAD.Drawing.17",""))

Is this possible? If so, how do I go about it? Why does it bring different
drawings in with the same number (16)? If I try to change the "16" on the
second drawing it gives me an error [The text you entered is not a valid
reference or defined name]. So many questions, so few answers. I am using
Excel 2000 & AutoCAD 2006.

Bob



Greg Wilson

Inserting a picture/drawing
 
Look in the Name Box (left of the Formula Bar) for the object's name. You can
change it if you like.

If there are only a few pictures involved, I think I would embed all the
pictures and toggle the visible property instead of inserting and deleting.
You probably know this, but a formula per se can't execute an action like
this (i.e. change the worksheet environment). You will need to use, for
example, worksheet event code or a macro.

Regards,
Greg

"Robert Dieckmann" wrote:

I am trying to set up a spreadsheet where it will embed one of two drawings
(which I copy-clipped from AutoCAD) based on a parameter within the
worksheet. I thought when I created the second drawing it would
automatically give a different formula, but both of them say:
=EMBED("AutoCAD.Drawing.16","").

In essence I'm looking for a formula such as this:
=If(A1="x",EMBED("AutoCAD.Drawing.16",""),EMBED("A utoCAD.Drawing.17",""))

Is this possible? If so, how do I go about it? Why does it bring different
drawings in with the same number (16)? If I try to change the "16" on the
second drawing it gives me an error [The text you entered is not a valid
reference or defined name]. So many questions, so few answers. I am using
Excel 2000 & AutoCAD 2006.

Bob




Robert Dieckmann

Inserting a picture/drawing
 
Thanks for the tip. Now the second half of the problem. How exactly do
I set up this event in VBA. I have re-named my two objects to fdnSB &
fdnHTT. I tried the following code but it did not work:

fdnSB.Visible = True

This should be simple, but what am I missing? Thanks for helping a
novice.



*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com