Announcement

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

  • Maddi Ball
    started a topic File not saving

    File not saving

    I'm attempting to export a file to Excel and I keep getting error 603 despite changing the permissions of the folder and the name of the file. It just tells me it 'could not be saved', anyone have any ideas why this may be the case?

  • Nick Cox
    replied
    #7 It's not an error to call export excel with no variables specified. How many do you have in memory when you try to export?

    Code:
    describe, short
    will tell you.

    #8 That's a good eye to spot that the date specification might be a problem, but the error message in #5 suggests that Stata is taking the file specification to go as far as
    .xls
    Last edited by Nick Cox; 16 Nov 2026, 04:32.

    Leave a comment:


  • Barna Szabo
    replied
    Originally posted by Maddi Ball View Post
    Hi eric_a_booth, thanks for your help! I have copied in the code as produced below, hopefully you can see I'm saving both files to the same folder, the first successfully, and have renamed the last (which failed to save) to today's date which I have not previously tried, but has continued to fail.

    Any help massively appreciated!

    . export excel using "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2
    > 026/CAD Excels/Radiolmerge.xls", firstrow(variables)
    file /Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/CAD Excels/Ra
    > diolmerge.xls saved

    . use "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/do files CA
    > D4TB/CAD 4 software April 2026.dta"

    . export excel using "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2
    > 026/CAD Excels/CAD 15/11/26.xls", firstrow(variables)
    file /Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/CAD
    Excels/CAD 15/11/26.xls already exists
    r(602);
    Maybe not explaining the error, but did you really intend to save it as "26.xls" at the path ".../CAD 15/11/"?
    ​​​​​​​Try to change the date delimiters in the file name from / to anything else, as Stata interprets that character as delimiter for folder names.

    Leave a comment:


  • Maddi Ball
    replied
    Even if I replace its coming up with 'too many or no variables specified, error(198)'
    and 603 if I specify the variables I require?

    Leave a comment:


  • Nick Cox
    replied
    Code:
    help export excel
    If you follow through to look at the command options, you will see that they include the option replace.

    Otherwise put, Stata won't let you just overwrite a file that already exists. That file might amount to days (weeks, months???) of work which you don't want to lose through a moment's aberration. Stata insists that you flag that you really want to replace it. (Perhaps you don't!)

    Leave a comment:


  • Maddi Ball
    replied
    Hi eric_a_booth, thanks for your help! I have copied in the code as produced below, hopefully you can see I'm saving both files to the same folder, the first successfully, and have renamed the last (which failed to save) to today's date which I have not previously tried, but has continued to fail.

    Any help massively appreciated!

    ​​​​​​​. export excel using "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2
    > 026/CAD Excels/Radiolmerge.xls", firstrow(variables)
    file /Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/CAD Excels/Ra
    > diolmerge.xls saved

    . use "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/do files CA
    > D4TB/CAD 4 software April 2026.dta"

    . export excel using "/Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2
    > 026/CAD Excels/CAD 15/11/26.xls", firstrow(variables)
    file /Users/madeleinebell/Documents/Global Health/CAD4TB Feb 2026/CAD
    Excels/CAD 15/11/26.xls already exists
    r(602);

    Leave a comment:


  • eric_a_booth
    replied
    Maddi Ball can you share the code that produced the error? You can also confirm that folder is writeable by having Stata -save- a simple test file there this helps ensure your path is correct.

    Leave a comment:


  • Maddi Ball
    replied
    Thank you!
    What process might have a lock on the file? Every time I save it with a different name its giving me error 602. I only have it open on stata from where I'm trying to export it? I haven't had this problem in the past?

    Leave a comment:


  • Leonardo Guizzetti
    replied
    PDF documentation for -help error- shows that error code 603 is for files that could not be opened. Is it possible that you have the target file open, or another process holding a lock on that file? What if you change the name of the file you try to write in the same target directory?

    Leave a comment:

Working...
X