Reputation: 281
I am trying to save data from SPSS to an excel file with multiple tabs. There is about 50 tabs and this needs done multiple times a year so there's no manual workaround.
In previous years, this is has worked flawlessly using "save translate outfile = ...
" and "/exceloptions sheet = 'name'".
I alter name for the different tabs.
However, the first tab is loading fine, but the second tab onwards is throwing an error.
"Error # 6452
An error occurred while the output file was being written.
Execution of this command stops"
Google / IBM problem page / IBM documentation are no help. I think that this is maybe a side effect of moving to the latest version of SPSS but it could be something else. It may also be to do with the unicode settings.
Any help??
Upvotes: 2
Views: 891
Reputation: 281
An answer that my company have come up with is to revert to the old SPSS 24 that we have.
Far from ideal but seems to work.
This reflects very poorly on IBM I feel. No wonder people are leaving for R.
Upvotes: 0
Reputation: 11310
This doesn't work for me either (spss 28). I used to do this a lot using EXPORT TO DATABASE, which produces syntax like this:
SAVE TRANSLATE /TYPE=ODBC
/CONNECT='DSN=Excel Files;DBQ=C:\Users\you\path\YourFile.xls;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;'
/ENCRYPTED
/MISSING=IGNORE
/REPLACE
/TABLE='YourSheetName'
/KEEP=var1 to var12.
NOTE however that this syntax seems to work only with old XLS files and won't connect to XSLX files - I couldn't find a way to make this work with newer Excel versions. Until you do find a way, a silly but usable workaround is to save your excel in XLS format, then the syntax will work. You can use that excel only as a receptor for your spss exports, and then read it into another, latest version, Excel file (automatically, best to use Power-Query).
Upvotes: 0