Run time error '438'. Object doesn't support this property or meth

M

MichaelDavid

I am having great difficulty referencing other workbooks and their worksheet
data from a macro in the Personal Workbook (PERSONAL.XLSB). For example, the
following instruction should be, but does not seem to be supported when it
occurs in a macro in my Personal Workbook, Personal.xlsb:
RowIndex = Workbooks("BookDates1.xlsm").Range("A19").
The following instruction is not supported either:
RowIndex = Workbooks("BookDates1.xlsm").cells(19, 1).
(RowIndex is defined as: "Dim RowIndex As Long" near the top of the Sub
Procedure.)
Both of these give the error message: "Run time error '438'. Object doesn't
support this property or method. My email address is (e-mail address removed) . Thank
you very much.
Sincerely,
Michael D Fitzpatrick

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick
 
N

Nick Hodge

Michael

You are missing the property you are returning at the end of the examples
you give. (I am presuming .Value). You should then be careful it is not
returning a Double, although that should not give you this error. I suspect
the .xlsm on the end of the file names as this should not be necessary if
the workbooks are open when the code is run, as they would need to be. (Even
if they are hidden)., so

Workbooks("BookDates1").Range("A19").Value

will work if the workbook is open

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
web: www.excelusergroup.org
web: www.nickhodge.co.uk
 
M

Michael Fitzpatrick

Hi Nick:
Thanks for your kind response. Actually what is missing is a reference to
the particular worksheet of workbook BookDates1 which contains the Range
(even though there is only one worksheet in workbook BookDates1). When I
fixed this as follows:
RowIndex = Workbooks("BookDates1").Worksheets(1).Range("A19")
the macro ran without a problem. May you have a blessed day.

Sincerely,

Michael D Fitzpatrick
 

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