My company just updated to Office 2016.
I have a spreadsheet with loads of code, created in Excel 2010, that has worked fine for months.
Since updating to 2016, the following line gives a type mismatch error (Error 2007):
Code
strStaff = IIf(IsError(DataRange(intRow, staffCol)), "(no staff)", Trim(WorksheetFunction.Proper(DataRange(intRow, staffCol))))
However if I change it to:
Code
If (IsError(DataRange(intRow, staffCol))) Then
strStaff = "(no staff)"
Else
strStaff = Trim(WorksheetFunction.Proper(DataRange(intRow, staffCol)))
End If
it works fine. Has IIf been removed from Office 2016?
Also posted here: http://www.mrexcel.com/forum/e…l-2016-a.html#post4652969