Forum Discussion

Bern458's avatar
Bern458
Experienced User
4 years ago
Solved

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 (Fleetmatics Work) and the excel code to convert the data has not changed in 15 months.  Attached is the myob error log for importing the nsw csv file and the import file.

 

Bernard Lakey

  • 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

3 Replies

Replies have been turned off for this discussion
  • Komal_S's avatar
    Komal_S
    MYOB Moderator

    Hi Bern458 


    I've tried to replicate this and was able to import both the files without any issues. The error you're getting can be caused if the path to that file is too long, therefore, can you please try saving the import file on the desktop and then try the import again.

    Let me know how you go on. 

    • Bern458's avatar
      Bern458
      Experienced User

      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

      • Komal_S's avatar
        Komal_S
        MYOB Moderator

        Hi Bern458 


        Thanks for explaining the solution. I'm sure other members of the community will find it useful.

        Feel free to post should you have other queries or suggestions.