ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run time error '438'. Object doesn't support this property or meth (https://www.excelbanter.com/excel-programming/406742-run-time-error-438-object-doesnt-support-property-meth.html)

MichaelDavid

Run time error '438'. Object doesn't support this property or meth
 
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 . Thank
you very much.
Sincerely,
Michael D Fitzpatrick

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick

Nick Hodge[_2_]

Run time error '438'. Object doesn't support this property or meth
 
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
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"MichaelDavid" wrote in message
...
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 .
Thank
you very much.
Sincerely,
Michael D Fitzpatrick

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick



Nick Hodge[_2_]

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

Glad you got it fixed

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"Michael Fitzpatrick" wrote
in message ...
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


"Nick Hodge" wrote:

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
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"MichaelDavid" wrote in message
...
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 .
Thank
you very much.
Sincerely,
Michael D Fitzpatrick

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick




All times are GMT +1. The time now is 01:07 PM.

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