How can I pass few variable in same path?


Here is what i use for the command. I put two variable together but unfortunely it doesnt detect the files inside the folder that I want.


Here is the result.

But if i click the exact excel files, then it should works.

hi @Muhamad_Izwan_Bin_Hamran ,
You assign file name as a string?
pls check file path in string?
regards,
LNV

Folder Name below is the string:
Path.Combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”,DateSerial(now.Year,now.Month,0).ToString(“MMMM yyyy”))

File Name below is the string:
“ZA01 “+Now.AddMonths(-2).ToString(“MM.yyyy”)+” - Draft”

Hi @Muhamad_Izwan_Bin_Hamran
I think miss extend of file,
in this is “.xlsx”
ex: “.xlsx” '.pdf", “jpg”,…
regards,
LNV

Path.Combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”,DateSerial(now.Year,now.Month,0).ToString(“MMMM yyyy”))+“ZA01 “+Now.AddMonths(-2).ToString(“MM.yyyy”)+” - Draft.xlsx”

Is this correct ?

I think
file name:
“ZA01 “+Now.AddMonths(-2).ToString(“MM.yyyy”)+” - Draft.xlsx”

folder name not have extend

you can test

regards,
LNV


still doesnt works. Any other way ?

You can paste string at file path to check correct or not


this error is in string is not correct–> not found
found this file in your folder, I will fix string for you

Path.Combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”,DateSerial(now.Year,now.Month,0).ToString(“MMMM yyyy”))+“ZA01 “+Now.AddMonths(-1).ToString(“MM.yyyy”)+” - Draft.xlsx”

If i paste this, it doesnt go to the folder and specific files that i wanted to you. Need help to fix my string.

Below is the actual folder
R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report

Your folder path
Path.Combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”,DateSerial(now.Year,now.Month,0).ToString(“MMMM yyyy”))

Did you check this folder correctly?

Im using below to go to folder:
R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report

I didnt put path. combine at the search bar

you can use

path.combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”, VVV)

considered you have your file name in VVV Variable.

sample:

path.Combine(“R:\CHARTERERS REPORTS\KCSM,KSL,KCSSG - Aging Report”, DateSerial(now.Year,now.Month,0).ToString(“MMMM yyyy”),
“ZA01”+Now.AddMonths(-1).ToString(“MM.yyyy”)+“-Daft”+“.xlsx”)

i need to paste this in search bar ?

you can test with your code

it doest work. Any other alternative way

can you tell me the specific folder path
and file path you want to get?

@Muhamad_Izwan_Bin_Hamran

  1. Check the folder path properly if ot is printing correct
  2. Better to remove dots from the filename ao that it not confused

Cheers