Announcement

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

  • importing .xlsx

    Hi, my STATA/SE 12.0 version does not allow importing excel files in .xlsx format. It gives error "Unable to Load excel file, permission denied." However i have no trouble in loading .xls files. Any solution? thanks.

  • #2
    There are many solutions, including upgrading to Stata 14 and accessing .csv files rather than .xlsx.

    Comment


    • #3
      Do you have read permissions for the particular file you are having difficulty with?

      Comment


      • #4
        Hello,

        I have exactly the same problem, though I use Stata 15 (updated). It used to work fine with xlsx files, but since a few weeks it does no longer work. I do not understand why, I tried to repair Stata installation but it did not change anything. I know I could use older Excel version or csv but it is not very convenient. Would you have an idea?
        Thanks much,

        Comment


        • #5
          I am using Stata 15, current update, and I have no difficulty importing .xlsx files--do it several times each day. You might want to post the exact code you are using and the exact output (including error messages) you get from Stata so somebody can scrutinize it for a possible mistake on your part. But if none is found, this would be something to refer to StataCorp technical support.

          Comment


          • #6
            Is the Excel file in question open? I just tried importing an .xlsx file right now, and if the Excel file was open at the time I tried to import, I got an error (see the code window). When I closed the Excel file I was able to import it without any problem. Worth a try anyway.

            Code:
            import excel using "C:\Documents\AUTM - STATT Data\OECD STI indicators\OECD - spend on R&D, 2008-2016.xlsx", sheet("Stata") firstrow
            file C:/Documents/AUTM - STATT Data/OECD STI indicators/OECD - spend on R&D, 2008-2016.xlsx could not be loaded
            r(603);
            Error 603 states:
            The file, although found, could not be opened. Check to see if
            it is currently open in another application or, if it is a file
            on your network, it is being used by another person. If it is
            not in use, check to see if the file is in a directory where
            you are allowed to create files.

            Comment


            • #7
              That's odd. I routinely import .xlsx files while I have them open, and there is no problem doing so. I wonder if that's a Mac vs Windows difference (I use Windows). I am not able to export to an Excel file that is currently open, but import works just fine.

              Comment


              • #8
                So, there was a Statalist entry on it here. I haven't looked into it since it is currently only a minor nuisance in my workflow. But I just updated Stata today and I still have the issue. (Stata 15.1, Windows 10, MSFT Office Pro 2016). I know that I used to be able to import open Excel files, but I don't remember when it stopped.

                Comment


                • #9
                  So based on the Statalist entry you linked to in #8, I think I am able to do this because I am running an archaic version of Excel (2010) on an antique version of Windows (7). My guess is that the more modern Excel or OS locks the file against writing and reading when it is open, whereas the older version did not. Well, IMO, just another way in which Microsoft software just keeps getting worse with each new version!

                  Comment


                  • #10
                    Originally posted by David Benson View Post
                    Is the Excel file in question open? I just tried importing an .xlsx file right now, and if the Excel file was open at the time I tried to import, I got an error (see the code window). When I closed the Excel file I was able to import it without any problem.
                    same here with Stata 15 and 14

                    Comment

                    Working...
                    X