Macro import

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"
 
R

Richard Choate

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"
 
C

Chip Pearson

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)
 
L

Lynn

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.
 

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