Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error with importing an excel file to STATA (3204 error)

    Hi, everyone.

    When I import my excel file to STATA, I have 3204 error as described below.

    import excel "m:\pc\dokumenter\folder\subfolder\filename.xl sx", sheet("Sheet1") first
    > row
    _xlshreadstringcolforce(): 3204 matrix found where scalar required
    import_excel_get_first_row(): - function returned error
    import_excel_load_file(): - function returned error
    import_excel_import_file(): - function returned error
    <istmt>: - function returned error



    The interesting fact is that I did not have any problems or errors to import the same file to STATA few days ago.
    However, when I try it today, the error occurs although I did not change anything in the excel file.

    I searched the manual, and it explains that "3204. matrix found where scalar required. An argument is required to be 1 1 and it is not."
    I do not have any idea why it happens.

    Any comments and helps would be highly appreciated.

    Thank you for your time.


  • #2
    There is a space in the file extension in

    Code:
    "m:\pc\dokumenter\folder\subfolder\filename.xl sx"
    that should probably not be there. Fix your file extension and make sure Stata is up to date. If the error persists, contact tech-support.

    The error message is not helpful here and I am pretty sure that it was not meant to be issued to the end-user; so, given you copy of Stata is up to date, you may contact tech-support either way because I would expect Stata to throw a more informative error message for spaces in file extensions.

    Best
    Daniel

    Comment


    • #3
      Daniel's guess looks good. Otherwise is your filename really

      Code:
      m:\pc\dokumenter\folder\subfolder\filename.xlsx
      ?

      If not: It's really not a good idea to edit what you typed guessing at what is or is not relevant to an answer. We need to see exactly what you typed.

      If so, different advice would be in order.

      Comment


      • #4
        Dear, Mr. Daniel Klein and Mr. Nick Cox

        Thank you for your answers, and I am sorry that I did not know my file extension would matter, so I edited it.

        m:\pc\dokumenter\Work\Data\0405_Base Data STATA.xlsx

        And I shortened the excel file name(like 0416) and tried it, but the same error occurs.

        I will contact tech-support. Thank you very much.
        Last edited by HYE CHOI; 16 Apr 2018, 08:14.

        Comment


        • #5
          I experienced this issue as well, and it was resolved by typing the command:

          update all, force

          In my case, I'm almost certain the issue was caused by getting a different laptop.

          Comment

          Working...
          X