so im trying to learn vbs scripting and im trying to write the date and time in a specifc cell.
from what i saw at google this should be enough in the file:
Sub InsertDate(param)
Range(param).Value = Date
End Sub
(this is my entire vbs file)
param is the cell i want. i passed in uipath the cell i want as a paramater, i also allowed excel to use the scripting in the settings.
any ideas why its not working? nothing changes in the excel and all i get is an error sound from windows.
im trying this. i also changed to excel application scopre (i worked on excel process scope), but now it says it cannot access the excel because it being used by another proccess.
but the excel is close
i managed to see the problem. the “Read cell” activity says that its taken already. so the excel application scope its holding it… cant i work with both of them together?
change code to this (just replace “Date” with “Now” , then it will add the time
Sub InsertDate(param)
Range(param).Value = Now
End Sub
it didnt work for you because the read cell activity you used is wrong, you should use the one that doesnt need you to input the filepath
the one you used (with filepath) will open the file, read cell and close file. This wont work because you already used excel application scope to open excel file, so you cant open the file again
whereas the one i used (no filepath) will read from existing file (opened by excel application scope) so it works