excel - translate code from batch to vba -


i have batch file process name msmdsrv.exe, pid number using tasklist port number using netstat connection type established.

at end export result file pbd_port.csv

for /f "tokens=2 delims=," %%f in ('tasklist /nh /fi "imagename eq msmdsrv.exe" /fo csv') (  set var=%%f )  /f "tokens=2 delims= " %%h in ('netstat -ano ^| findstr established ^|   findstr %var%') (  set var1=%%h )  echo %var1% > pbd_port.csv 

i use code port number of powerbi desktop, change every time when launch power bi desktop.

is possible have macro in excel same thing ? instead of using batch file user has click on it, want macro give same result , write result not in csv in worksheet.

edit : built code batch, wanted general advice how translate vba, comment

edit : actually, on complicating things, port number stored in temporary text file generated new ssas instance, see different solution here

http://community.powerbi.com/t5/desktop/connect-to-powerbi-desktop/td-p/87310


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -