How to pass variable in Config file


#1

Hi,

How to pass variable i config file.

I need to pick excel from config file,and that excel file name have variable of today’s date.


#2

I assume you want to open the file? If so you could Open file with the variable similar to below:

in_StrExcelFile (however you’ve passed in your config filename) + " " +now.date(“format of how the date is shown”)

This will add the date to the end of the filename after a space, does this help?

(This assumes you are using ReFramework and have “InitAllSettings” set up to read your config file already?)


#3

Tnk u Alex
My excel file format is something like this D:\folder \folder name - Date.Now.To string(“MM-dd-yyyy”)\filename.xlsx"


#4

So this is part of your config file?


#5

Yes nadim


#6

So i tried to workaround this but really cant use a VB expression as it stores all the data as a String/Object as is rather than evaluating the expression and using the result which seems valid enough as we are just loading the config.

One workaround i can think of is, use a identifier say ‘currdate’ in your config path like
D:\folder\folderName-currdate\filename.xlsx’ and
in your assign where you are fetching the value you can replace that with the date like Config(“filepath”).ToString.Replace(‘currdate’,Now.Date.ToString(MM-dd-yyyy))


#7

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