Announcement

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

  • Can’t run -putexcel- with the sub-option rownames from within a do-file!

    When I try to execute a do-file writing a matrix to Excel including the row-names, I gen the following error
    option rownames not allowed
    r(198);


    My test do-file looks like this:

    ____ start of do-file ______
    putexcel set "Test.xlsx" , sheet(Test) modify
    mat bp=1,2
    mat rown bp = "Test"
    putexcel A1=matrix(bp)
    putexcel A2=matrix(bp), rownames
    ____ end of do-file ______

    Only the first putexcel commando gets executed. The second putexcel commando (the one with the rownames sub-command) triggers the error message.

    Executing the same 5 command lines from the command line runs without any problems.
    I am using Stata MP 15 (64-bit) on a Windows computer.

    Whar am I doing wrong?

    Regards Kim


  • #2
    I don't know. Your code runs perfectly on my setup.

    Are you using the current version of Stata, 15.1? I'm not a frequent user of -putexcel-, but I do know that its syntax has changed over time, and if you are running an older version, perhaps -rownames- had not been introduced as an option back then? If you are running current Stata, I suggest running -update all- to make sure you that you have the most recent updates, and that there are, therefore, no problems perhaps of incompatibilities between versions of ados and executables and mata code. If that doesn't solve the problem, there are the following standbys:

    1. Reboot your computer and try again.

    2. Try a fresh install of Stata.

    If none of this solves your problem, it sounds like you will need to contact Stata technical support.

    Comment


    • #3
      Hi Kim,

      I have a same issue now. Have you figured out this issue?

      Thank you, Lee

      Comment

      Working...
      X