I have been making a lot of proofs and seemed to be :
1. I used setx for changing environmental variables. And get it because examining Mi PC - properties..... . I observ the new value.
but inside excel seem not to be affected, or the bat created to execute the word doc with the variable path.
It's this correct. The change is not instantanous.....
2. I use a .reg file to change the environmental variable with good results, but this change seem take not effect in my bat file or inside excel.
So I'll try to close user session or reiniate the system and comment. ......
Edited : The problem is that the variables are not refreshed instanly in excel.
1. Really I don't need reiniate o close user session. What I did to obtain the actual value of varexpediente in the excel cells was re-write in the cells the name of the variable or the formula and goes well. .....
There is no way of appearing instanly the new value of the variable varexpediente ?
2. The other method with the text file goes well. I obtain instanly the same result in the cell, in the hyperlink and in the text file .txt .