Is there a specific reason you're using DDE to import Excel data?
And what doesn't work? You haven't explained how it doesn't work...
I am able to immport when file is in .xls format but it is not working on .xlsx file, as i want to connect sas with .xlsx with the help of DDE
Maybe: Is the file already opened in Excel?
Art, CEO, AnalystFinder.com
I am able to immport when file is in .xls format but it is not working on .xlsx file, as i want to connect sas with .xlsx with the help of DDE
Not working means absolutely nothing. Please include more information. Did the file open in Excel? Was there any errors? In Excel or SAS?
I am getting error that file is not available. I think it means sas is not able to connect to the .xlsx file
my code is working with .xls file and with .csv file
You never addressed why you would use DDE? I assume it's because if licensing issues?
You dont need the DDE for the CSV file.
For the XLSX file what happens when you run the connection string alone? I'm assuming it doesn't connect and Excel doesn't open so work on fixing the DDE statement. What version of Excel do you have? If it's 2013+ I have heard cases where DDE was no longer functional.
Look at the different DDE options for connections.
Post a screenshot of the error you receive.
As others have stated there is not enough information for us to debug. What I would however state is that DDE is old - very old. It was discontinued over 10 years ago and is really not recommended for use on anything now. In certain setups it doesn't work at all. I would really advise that you change your data handling policy, for instance is there a reason why you read in the data this way, rather than saving the data to CSV, there doesn't appear to be any funky Excel specific things going on as you are reading from first data row/column to end, so no reason to try any Excel specific things. Depending on the file you may even get away with just:
libname tmp xlsx "<path to your file><yourfile>.xlsx";
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.