Hi All,
I have workbook which is prompting the user to save a copy as...acting like a sort of template I guess. I have a routine which runs when the workbook opens to test whether the workbook name matches the default name, if it does then the user is prompted to save a copy, if not, it does nothing. I had this working fine in a test workbook, but when I copied the module over to the actual workbook I got a compile error: Type mismatch. The code is fails on is..
If MyName = "Forecast Template.xlsm" Then
Where MyName is defined as
Function MyName() As String
MyName = ThisWorkbook.Name
End Function
The debug highlights the "=" sign when the code is run. Can anyone help me please?
Note: I have also tried replacing the = sign with "Is".
Thank you
Bookmarks