Hi,
I have a spreadsheet, which pulls data from Wonderware Historian into Excel, which I later graph. The spreadsheet has a few very small macros, but it now takes a very long time to open. Excel starts by (not responding) [not even calculating, pretty sure], and ends with the Type Mismatch (error 13) error, before it allows me to work with the spreadsheet.
The macros I have are:
Private Sub Workbook_Open()
Application.Calculation = xlManual
Application.CalculateBeforeSave = False
ActiveWorkbook.RefreshAll
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CalculateBeforeSave = True
Me.Save
End Sub
Function LastSaved() As Date
Application.Volatile
LastSaved = ThisWorkbook.BuiltinDocumentProperties(12)
End Function
These macros are used to choose when to calculate and pull data from the Historian client, otherwise it takes a long time to work with the spreadsheet (save all the changes till last), and also to output when the spreadsheet was last saved.
Why am I getting a type mismatch error, and perhaps more importantly, why is my spreadsheet "not responding" for such a long time before reaching the error?
I have a spreadsheet, which pulls data from Wonderware Historian into Excel, which I later graph. The spreadsheet has a few very small macros, but it now takes a very long time to open. Excel starts by (not responding) [not even calculating, pretty sure], and ends with the Type Mismatch (error 13) error, before it allows me to work with the spreadsheet.
The macros I have are:
Private Sub Workbook_Open()
Application.Calculation = xlManual
Application.CalculateBeforeSave = False
ActiveWorkbook.RefreshAll
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CalculateBeforeSave = True
Me.Save
End Sub
Function LastSaved() As Date
Application.Volatile
LastSaved = ThisWorkbook.BuiltinDocumentProperties(12)
End Function
These macros are used to choose when to calculate and pull data from the Historian client, otherwise it takes a long time to work with the spreadsheet (save all the changes till last), and also to output when the spreadsheet was last saved.
Why am I getting a type mismatch error, and perhaps more importantly, why is my spreadsheet "not responding" for such a long time before reaching the error?