.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SetCellBackgroundColor

13 REPLIES 13
Reply
Message 1 of 14
Anonymous
1223 Views, 13 Replies

SetCellBackgroundColor

I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: Anonymous

Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 3 of 14
Anonymous
in reply to: Anonymous

So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 4 of 14
Anonymous
in reply to: Anonymous

The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 5 of 14
Anonymous
in reply to: Anonymous

I am still having problems with this. Can anyone help? My errors and code
are below.

Nate


"Tony Tanzillo" wrote in message
news:5655187@discussion.autodesk.com...
The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 6 of 14
Anonymous
in reply to: Anonymous

I thought my last post would give you a hint,
but if that didn't, and the painfully obvious error
message also doesn't, and you're not able to
do so little as look up the function in the docs
to find out what arguments it takes, then I don't
see how you are going to get much further after
you finally figure out how to get over this little
bump.

Open the docs and look up the function.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message news:5663782@discussion.autodesk.com...
I am still having problems with this. Can anyone help? My errors and code
are below.

Nate


"Tony Tanzillo" wrote in message
news:5655187@discussion.autodesk.com...
The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 7 of 14
Anonymous
in reply to: Anonymous

dude relax! I have looked at the function in the docs. In fact, this exact
example I gave you worked perfectly in VBA but does not in .NET. This is
why I am asking the question. Not because I have not done my research. If
you are having a bad day just don't answer any posts!



"Tony Tanzillo" wrote in message
news:5665118@discussion.autodesk.com...
I thought my last post would give you a hint,
but if that didn't, and the painfully obvious error
message also doesn't, and you're not able to
do so little as look up the function in the docs
to find out what arguments it takes, then I don't
see how you are going to get much further after
you finally figure out how to get over this little
bump.

Open the docs and look up the function.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5663782@discussion.autodesk.com...
I am still having problems with this. Can anyone help? My errors and code
are below.

Nate


"Tony Tanzillo" wrote in message
news:5655187@discussion.autodesk.com...
The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 8 of 14
bryanhay
in reply to: Anonymous

Tony did give you a hint (or a couple). Keep in mind I'm no .NET expert, but the VBA version of GetCellBackgroundColor requires that you specify the row and column of the cell whose background color you're trying to get. This seems to be missing from your sample code. Hope this helps.
Message 9 of 14
Anonymous
in reply to: Anonymous

If you looked at the function in the docs, and
from that you weren't able to figure out that
the GetCellBackgroundColor requires arguments
that your code didn't supply, then you probably
should not be attempting to do any kind of
programming.

Sorry, I have no patience for this degree of
helpless-ness.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message news:5673881@discussion.autodesk.com...
dude relax! I have looked at the function in the docs. In fact, this exact
example I gave you worked perfectly in VBA but does not in .NET. This is
why I am asking the question. Not because I have not done my research. If
you are having a bad day just don't answer any posts!



"Tony Tanzillo" wrote in message
news:5665118@discussion.autodesk.com...
I thought my last post would give you a hint,
but if that didn't, and the painfully obvious error
message also doesn't, and you're not able to
do so little as look up the function in the docs
to find out what arguments it takes, then I don't
see how you are going to get much further after
you finally figure out how to get over this little
bump.

Open the docs and look up the function.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5663782@discussion.autodesk.com...
I am still having problems with this. Can anyone help? My errors and code
are below.

Nate


"Tony Tanzillo" wrote in message
news:5655187@discussion.autodesk.com...
The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 10 of 14
Anonymous
in reply to: Anonymous

There isn't as strong of a connection between VBA and VB.NET as you might
think.

The .NET wrappers you use with VB.NET are (mostly) derived from the C++
ObjectARX API and are not COM based. While you can use the same COM/ActiveX
API VBA uses from VB.NET, that API is not the same thing as the .NET
wrappers (and is not the topic of this newsgroup).

Finally, VBA is going away (being replaced with VSTA which is .NET based),
so moving to VB.NET is a good idea. Just keep in mind that
cutting-and-pasting code will only get you so far.

Dan

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 11 of 14
Anonymous
in reply to: Anonymous

I think you guys are missing where my error is. It is not with the row and
the colum it is with the color. This is the line I error on. and I am
setting the row and column.

Dim newColor As AcadAcCmColor
newColor.SetRGB(230, 230, 230) 'This line errors out

and I am setting the row and column with:
myTable.SetCellBackgroundColor(y - 1, x - 1, newColor)

Thanks for you help.

wrote in message news:5673888@discussion.autodesk.com...
Tony did give you a hint (or a couple). Keep in mind I'm no .NET expert,
but the VBA version of GetCellBackgroundColor requires that you specify the
row and column of the cell whose background color you're trying to get.
This seems to be missing from your sample code. Hope this helps.
Message 12 of 14
Anonymous
in reply to: Anonymous

Sorry, we're not missing nothing.

I told you can can get an existing AcadAcCmColor
object by calling GetCellBackgroundColor.

You then tried to call the function but failed to
give it the arguments it requires, and you didn't
have so much as a clue as to what you were
doing wrong.

You then said you read the docs, which clearly
shows that the function takes arguments, but
you still can't seem to figure that out.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message news:5675217@discussion.autodesk.com...
I think you guys are missing where my error is. It is not with the row and
the colum it is with the color. This is the line I error on. and I am
setting the row and column.

Dim newColor As AcadAcCmColor
newColor.SetRGB(230, 230, 230) 'This line errors out

and I am setting the row and column with:
myTable.SetCellBackgroundColor(y - 1, x - 1, newColor)

Thanks for you help.

wrote in message news:5673888@discussion.autodesk.com...
Tony did give you a hint (or a couple). Keep in mind I'm no .NET expert,
but the VBA version of GetCellBackgroundColor requires that you specify the
row and column of the cell whose background color you're trying to get.
This seems to be missing from your sample code. Hope this helps.
Message 13 of 14
Anonymous
in reply to: Anonymous

I figured it out. I finally saw what you were talking about. I was not
looking at the GetCellBackgroundColor. Sorry for my ignorance.


"Tony Tanzillo" wrote in message
news:5674000@discussion.autodesk.com...
If you looked at the function in the docs, and
from that you weren't able to figure out that
the GetCellBackgroundColor requires arguments
that your code didn't supply, then you probably
should not be attempting to do any kind of
programming.

Sorry, I have no patience for this degree of
helpless-ness.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5673881@discussion.autodesk.com...
dude relax! I have looked at the function in the docs. In fact, this exact
example I gave you worked perfectly in VBA but does not in .NET. This is
why I am asking the question. Not because I have not done my research. If
you are having a bad day just don't answer any posts!



"Tony Tanzillo" wrote in message
news:5665118@discussion.autodesk.com...
I thought my last post would give you a hint,
but if that didn't, and the painfully obvious error
message also doesn't, and you're not able to
do so little as look up the function in the docs
to find out what arguments it takes, then I don't
see how you are going to get much further after
you finally figure out how to get over this little
bump.

Open the docs and look up the function.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5663782@discussion.autodesk.com...
I am still having problems with this. Can anyone help? My errors and code
are below.

Nate


"Tony Tanzillo" wrote in message
news:5655187@discussion.autodesk.com...
The name of the function is GetCellBackgroundColor.

Doesn't that mean that you need to tell it
what cell background color you want?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653661@discussion.autodesk.com...
So I am not following. I should:

newColor = myTable.GetCellBackgroundColor
newColor.SetRGB (204,204,204)
myTable.SetCellBackgroundColor (y, x, newColor)

If I do this the first line above will error out. Below is the error:

Error 1 Argument not specified for parameter 'col' of 'Public Function
GetCellBackgroundColor(row As Integer, col As Integer) As
Autodesk.AutoCAD.Interop.Common.AcadAcCmColor'.

Any other Ideas?


"Tony Tanzillo" wrote in message
news:5653126@discussion.autodesk.com...
Can't tell you why creation of the COM object fails, but
you can just use the existing AcadAcCmColor object that's
returned by calling GetCellBackgroundColor, rather than
creating a new instance. Call that method to get the color,
set its RGB, and then pass it to SetCellBackgroundColor.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Nate Hunter" wrote in message
news:5653007@discussion.autodesk.com...
I am running into problems with setting the cell background color in a
table. Here is what I am trying to do which worked in VBA but does not in
VB.net. What can I do to set the background color of a cell. I should also
tell you I need everyother cell shaded a different color. Thanks.

Dim newColor As AcadAcCmColor

newColor = New AcadAcCmColor

newColor.SetRGB(204, 204, 204)

myTable.SetCellBackgroundColor( , x, newColor)



The error I recieve is: Retrieving the COM class factory for component with
CLSID {C8C18F89-794D-466B-8B97-95634D9890EF} failed due to the following
error: 8007007e.
Message 14 of 14
Mikko
in reply to: Anonymous

Dim newColor As AcadAcCmColor
newColor = AcadApp.GetInterfaceObject("AutoCad.AcCmColor.17")
newColor.SetRGB(255, 255, 0)
MyTable.SetCellBackgroundColor(y - 1, x - 1, newColor)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost