Macro import

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

I wrote a macro in XP to import data from one excel file
to another excel. The macro runs fine in XP but I keep
getting this error in 2000.

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

When I click debug it takes me to this line of code:

..SourceDataFile = "E:\filepath\filename.xls"
 
There are a number of methods which are not available in 97. This is likely
one of them.
--
HTH
Richard Choate, CPA

I wrote a macro in XP to import data from one excel file
to another excel. The macro runs fine in XP but I keep
getting this error in 2000.

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

When I click debug it takes me to this line of code:

..SourceDataFile = "E:\filepath\filename.xls"
 
Lynn,

The SourceDataFile property was added in Excel 2002. It doesn't
exist in earlier versions. If you need to support earlier
versions, you can't use SourceDataFile.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
It works now. I removed the line of code causing the
error. I recorded the macro and it wrote the line of code
but the macro runs without it so I am not sure what that
line was for.
 
Back
Top