Have a program that\'s dynamically generating an Excel file and a csv. The excel file has VBA code that loads the csv data \"on load\" and I want to dynamically call that csv by
Replace could be exactly what you want:
Function GetFullNameCSV() As String
GetFullNameCSV = Replace(ThisWorkbook.FullName, ".xls",".csv")
End Function
You can extend this by including the extension you want like so:
sFileName = GetNewExt("pdf")
Function GetNewExt(Ext As String) As String
GetNewExt = Replace(ThisWorkbook.FullName, ".xls","." & Ext)
End Function