

Set objWorkbook = (Source1 & MyVar &"\Result.csv") ' => Issue here Source1 = "C:\Users\tanzil\Desktop\Test\" Set objExcel = CreateObject("Excel.Application") Set ObjFile = ObjFso.OpenTextFile(StrFileName) Set ObjFso = CreateObject("Scripting.FileSystemObject") StrFileName = "C:\Users\tanzil\Desktop\Test\Test.txt"

How do i set the string value (MyVar) so that it can be used as path? Thank you for the input Problem here is the parentfolder from Result.csv. I wrote the following vbs script to automatically do this, but excel cannot find the file. My goal is to change to a directory name with this string value and then plot a scatter diagram for the csv file inside this Folder. Now, assuming that I have a text file (Test.txt) with one random number that I've calculated. The name always start from 1 and forwards depending on the number of the cycle in external program.

I got a bunch of directories from external software program.
