Here is a pretty automated solution. The attached code opens all the sheets in
the specified Excel file and merges them.
First, you need to go to Extensions > Extension Hub and install the extension
command STATS PACKAGE INSTALL.
Then, run the first command in the attached file, which uses this extension, to add a Python library module that can read Excel files. You only need to do that once.
In the code that follows, change this line
filename=r"c:/temp/twosheets.xlsx"
to specify the name of the file you want to import. Be sure to preserve the r in front of
the quoted text.
Then select everything from begin program through end program and execute it.
It will read in all the sheets in the Excel file and merge them and then close all of them
leaving just the merged file.
There are two important qualifications. In the Excel sheets, the column names, which
will become variable names, must be legal SPSS variable names, and they should all
be distinct. And the sheet names must also be legal as SPSS variable names except
that any blanks will be ignored.
This code should work with SPSS 27 or later.
Let me know how this works for you.
--