CallByName in Excel for Fill object

G

Guest

Thank you very much for your time and help.

I am trying to access the Fill object in Excel, by its name.

The object is instancenable, becuse the the following command works.

Set o1 = Excel.ActiveWorkbook.Sheets(1).Shapes(1).Fill

How the command below returns the error 438 - object does not support this
property or method.

Set o2 = Excel.ActiveWorkbook.Sheets(1).Shapes(1)
Set o3 = CallByName(o2, "Fill", VbGet, Empty)

Can you please help me resolve this problem or find a work around?

Thank you very much for your help.
 
P

Peter T

This worked for me -

Set o2 = Excel.ActiveWorkbook.Sheets(1).Shapes(1)
Set o3 = CallByName(o2, "Fill", VbGet)

MsgBox TypeName(o3) ' FillFormat

as did -

Set o3 = o2.Fill

Regards,
Peter T
 
G

Guest

Dear Peter thank you very, very much!

Peter T said:
This worked for me -

Set o2 = Excel.ActiveWorkbook.Sheets(1).Shapes(1)
Set o3 = CallByName(o2, "Fill", VbGet)

MsgBox TypeName(o3) ' FillFormat

as did -

Set o3 = o2.Fill

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top