Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find and replace in excel

Status
Not open for further replies.

borsker

Programmer
Jul 24, 2002
147
US
I am trying to get an excel sheet into vfp, however there is one column that the customer keeps sending over with carrige returns in it. when i try the IMPORT from ... TYPE xls, i get a "Microsoft Excel file format is invalid." error. I was wondering if it had something to do with the carrige returns. Anyway, besides that, I was looking to do a find and replace of the carriage returns in excel through vfp. i just do not know what code to use.
The macro for excel is very lengthy and i am not sure what to use out of it. Even if the carriage return is not the error for "Microsoft Excel file format is invalid." i would still like to know how to use the find and replace.
 
Borsker,

Why don't you try this ...

Copy a single row of the worksheet to a new sheet. Try to import it. Assuming you get the same error, manually remove the CR within Excel. Then try again. If the error goes away, you've answered your question.

I suggest you do that before you start trying to replace all the CRs programmatically.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I always copy the sheet I want to import and do a paste special values into a fresh workbook before the import command. It resolves most format and special character related issues.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top