Forum Discussion

Bern458's avatar
Bern458
Experienced User
4 years ago

Importing sales Invoices

HI  The import process has been working fine but last week started producing the attached error file.  I can not see what has changed in the creation of the import data file from the source (Fleetma...
  • Bern458's avatar
    Bern458
    4 years ago

    HI Komal 

     

    Thanks for your answer.  the import file was just the first 2 records out of thousands as an example of the import  format.  I have finally figured it out.  Somewhere in the source data system a user is inserting a carrage return in the notes field.  While excel code can deal with the the carrage return the import process in Myob turns the carrage return into a new record.  Not so easy to find in throusands of rows.  But for any one interested in excel code these line will find and remove both line feeds and carrage returns - but does run a bit slower!

    Cells.Replace What:="" & Chr(13) & " ", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
    Cells.Replace What:="" & Chr(10) & " ", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2