Hit type mismatch error at the saveas filename row , and i believe its because there is a mixture of string and integer for the variable in the filename. Can anyone advice on this?
VBA Code:
Dim prd as string, dept as string, yrs as integer
prd=ThisWorkbook.Sheets("Main").Range("I10").value
dept=ThisWorkbook.Sheets(Main").Range("I11").value
yrs=ThisWorkbook.Sheets(Main").Range("I12").value
ChDir ThisWorkbook.Sheets("Main").Range("I13").value
:Activeworkbook.saveas filename := "EKYC" + prd + "_" + yrs + "_" + "dept" + ".xlsm"