06-25-2017 09:32 PM
I know launching PC SAS from excel VBA might be old, but this code use to work on a 32 bit windows machine
when I used Excel Vba:
Dim SAS As Object
Set SAS = CreateObject("SAS.Application")
SAS.Visible = True
Now, that our IT department gave me a 64 bit windows machine I get the following error in SAS: "Error: Configuration file "%_SASHOME%\SASFoundation\9.4\SASV9.CFG"" is unreadable."
The funny thing is that the error occurs only when invoking SAS from excel vba. If I start SAS by clicking on the actual program, it launches SAS normally. The machine has SAS 9.4 64 bit installed. Also, its has office 365 ( Excel 2016).
Anybody with a solution ? is it because of the 64 bit installation of SAS ? Thanks
06-26-2017 09:53 AM
Not sure how to change the environment variable when its launching from excel. Yet, when I just click on SAS to open an issue, there is no need to change the environment variable since it opens normally.
06-26-2017 10:34 AM - edited 06-26-2017 10:39 AM
if %_SASHOME% resolves to a valid path when entered in the adress bar then your windows environment variable is correct. If not I would try %SASHOME%
That's one thing.
The second thing is that the paths in your config file may have changed, you will need to check them too.
- Cheers -
06-26-2017 11:13 PM
So, the result I get is that It can't find the path "%_SASHOME%\SASFoundation\9.4\SASV9.CFG". That makes sense because SAS 9.4 is installed in the following: C:\Program Files\SASHOME\SASFoundation\9.4. Yes, the initial configuration file is there and then points to \nl\en\SASV9.CFG. It's odd that excel invokes it to that incorrect directory, but the SAS application itself opens it correctly.
06-27-2017 10:19 AM
There's a lot references. Does show "C:\program files\SASHOME\x86\Secure\ccme4". Don't know what that means, but I don't see anything related to SAS in the "C:\program files(x86)".
06-27-2017 06:53 PM
This does not look right. It's as if SAS was not installed there.
You have none of the expected environment variables, such as SASHOME, SASROOT, SASCFG, etc.
A quick fix to make the reference VBA call work would be to create the environment variable _SASHOME pointing to wherever the config file is. Something like:
set _SASHOME=C:\Program Files\SASHOME\SASFoundation\9.4\SASV9.CFG
You do this for the whole Windows session not just in a DOS command line Window.
But something is not right with your installation it seems.
06-29-2017 08:08 AM
SAS is installed but the environment variable _SASHOME is not defined. Consult your IT and describe the problem, that's part of their job. You could do it by yourself, but then it's your responsability if something goes wrong.
- Cheers -