I have a spreadsheet that is using the WORKDAY() function in Excel (which I believe lives in the Analysis Toolpak library/package/whatever you call it in Excel). When I open this spreadsheet manually and call this function it behaves fine.
I have a macro that references the cell that the WORKDAY() function is used in:
Dim startDate as Date
startDate = Cells(1,1)
When I run the macro after opening the spreadsheet manually this code executes fine. The problem is when I try and open the spreadsheet and run the macro from my C# code. It will then fail when it tries to get the value for startDate. When I look at that cell I see a #VALUE! reference error. It seems like it is not loading the correct references when I open the spreadsheet from my C# code.
Does anyone know how to resolve this issue?