Refresh Excel TFS query

Hi, I’m using the TFS plugin for Excel to import the results of a small TFS query into an Excel worksheet. I have an automated process that refreshes all connections for my workbook, but because this activity doesn’t include freshing the TFS query, I’m having to resfresh this manually, which makes automating the rest of it pointless. Does anybody know how to automatically refresh the TFS query when refreshing the other connections?


Welcome to the community…

Please check the below link which gives details about refreshing tfs from Vba…

You can save the vba into text or .vba filea nd then use invoke vba to start the vba from UiPath

Synchronize TFS and Excel via VBA - Info Support Blog.

Alternately you can try this activity if that works


Thanks for that, but I’m getting an error when I try to invoke the VBA - it says it needs an argument. I’m using the VBA code that’s in the link you provided. Do you know what argument it’s looking for?


Can you show which one you used?

Basically whatever you see in the first like between brackets is what is the input its looking for…

Function gettext(abc as string) you have to pass the value of abc which is a string type



This is the message I’m getting…


I’m using the exact VBA code from the link earlier, only thing I’ve changed is the Excel sheet name “TFSQuery”. I first set the argument as type string, but that didn’t work - I got the same error, so then I changed it to type object, but got the same error again. I know it’s something I’ve overlooked, but I can’t work out what I’m missing.


The error says that the tfsquery variable value is null…

Please check if a value is assigned to it


I’m not sure if a value is assigned, or even what value it should be. I’m starting to wonder if the original VBA code actually works at all, because all I’ve done is change the Excel sheet name where the TFS query loads the table, that’s the only change I’ve made to the original code. Does the code work for you?



Go to excel → Developer → Visual Basics , then paste the code in there and try running it…

then you will know if its working or if there are any errors


Just pasted the code into Excel, it didn’t work. I guess that’s my answer! :slight_smile:

Thank you for all your help, really appreciated


Are you getting any error?

If not i beleive as this function you did not call it at all…you have to call from another sulike below

Sub try()


End sub



Thanks for your help. Unfortunately I’m really confused as to what I should be running/calling. Is it possible you could provide some idiot-proof steps/screenshots that I can follow? Sorry, I’m still very new to UiPath, and on top of that, I know virtually nothing about VBA.

For a short-term workaround, I’ve used the app recorder to record the steps in refreshing the TFS query. This takes off the immediate pressure of trying to get something in place. It’s unfortunate that refreshing a TFS query via UiPath is so troublesome, especially when you consider how awesome Studio is.


I found the issue. In the original script, the quote marks - " " and ’ ’ - were typed incorrectly, causing Excel to ‘lose’ the Team tab and causing the script to fail. By overtyping those quote marks, it corrected the errors and the script ran fine! :slightly_smiling_face:

Thanks again for your help @Anil_G

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.