You deleted the three bottom lines, saved the script, ran it and it closed your Excel file? Did you see any data paste in?
You don't see Excel though?
No I do not see Excel
Once you've eliminated the path as an issue (ballardw suggestion), which I would first do, try the following:
Save the following as .vbs file anywhere on your desktop and run it. If Excel doesn't launch that's an issue:
Dim objExcel
Dim Newbook
Dim NewSheet
Dim inSheetCount
Set objExcel = CreateObject("Excel.Application")
Set Newbook = objExcel.Workbooks.Add()
objExcel.Visible = True
It opens an Excel sheet with your code.
Thank you @reeza I appreciate your input. Now I think I know what the problem is . When I see command line like pop up there was another pop up I missed before since it is literally for less than 1/10 secs. It says "The X command is active. Enter EXIT at the prompt in the X command window to reactivate this SAS session."
Here is the update on my problem. I think I am very close to the answer:
I found out that I do not have write access to SAS default temporary folder therefore I directed my temp folder to my own folder in desktop.
I did not know that we have to give default folder name for clip file so I give C:\temp as destination folder for clip.
Finally I am able to copy and paste table ( I used SASHELP.CARS) but will little problem. I am not able to write any variables after Horsepower variable in SASHELP.CARS. I thought that was LRECl issue and changed value to 32767 but still I am missing last 4 variable in my output. One thing I notice in my Clip.txt file is I am getting more than one tab between two copied column.
I am wondering if you know what would be the issue.
Thank you,
With the path C:\Users\myname\Desktop\ do you actually have "myname" as part of the path on your drive?
Understand but if the spelling doesn't match exactly then the path doesn't exist and the macro documentation explicitly says that the path must exist. An extra or missing space might be easy to miss and its easy to check as a possibly problem.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.