Rename problem

Your file path looks fine. Wonder why you are getting that error…

Can i know the data types of those two variables valstart and valend?

@jiejie is your two variables are of datetime data type?

@Lahiru.Fernando my datatype for valStart and valEnd are string.

HI @jiejie

I see. I thought it was a datatime variable. That’s why I asked you to convert the format. If its string, try the below command.

valstart.Replace("/","-").Trim + valend.Replace("/","-").Trim

“c:\Timesheet\”+ valstart.Replace("/","-").Trim + valend.Replace("/","-").Trim +".xlsm"

This will work for you :slight_smile:

Let know how it goes

@Lahiru.Fernando Thank you so much. It work already.

1 Like

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