Visual Basic "originated from an internet" EXCEL
-
I have a visual basic application developed to read an EXCEL file. It is written with late binding because my development machine has Microsoft.Office.Interop.EXCEL 14 and the production machines uses Microsoft.Office.Interop.EXCEL 12. We get an error opening the workbook on the production machine but not on the development machine. It only happens for files that have the "originated from an internet" ADS. Is there an EXCEL or FILE setting I have missed?
Dim oXL As Object = CreateObject("Excel.Application") Dim oWBK As Object = oXL.workbooks Dim oWS As Object = CreateObject("Excel.Sheet") oXL.AutomationSecurity = 3 oXL.DisplayAlerts = False oXL.Visible = False oXL.AskToUpdateLinks = False oWBK = oXL.Workbooks.Open(Path.Combine(l\_s\_SourcePath, l\_s\_SourceFileName), UpdateLinks:=False, ReadOnly:=True, CorruptLoad:=1)
-
I have a visual basic application developed to read an EXCEL file. It is written with late binding because my development machine has Microsoft.Office.Interop.EXCEL 14 and the production machines uses Microsoft.Office.Interop.EXCEL 12. We get an error opening the workbook on the production machine but not on the development machine. It only happens for files that have the "originated from an internet" ADS. Is there an EXCEL or FILE setting I have missed?
Dim oXL As Object = CreateObject("Excel.Application") Dim oWBK As Object = oXL.workbooks Dim oWS As Object = CreateObject("Excel.Sheet") oXL.AutomationSecurity = 3 oXL.DisplayAlerts = False oXL.Visible = False oXL.AskToUpdateLinks = False oWBK = oXL.Workbooks.Open(Path.Combine(l\_s\_SourcePath, l\_s\_SourceFileName), UpdateLinks:=False, ReadOnly:=True, CorruptLoad:=1)
-
I have a visual basic application developed to read an EXCEL file. It is written with late binding because my development machine has Microsoft.Office.Interop.EXCEL 14 and the production machines uses Microsoft.Office.Interop.EXCEL 12. We get an error opening the workbook on the production machine but not on the development machine. It only happens for files that have the "originated from an internet" ADS. Is there an EXCEL or FILE setting I have missed?
Dim oXL As Object = CreateObject("Excel.Application") Dim oWBK As Object = oXL.workbooks Dim oWS As Object = CreateObject("Excel.Sheet") oXL.AutomationSecurity = 3 oXL.DisplayAlerts = False oXL.Visible = False oXL.AskToUpdateLinks = False oWBK = oXL.Workbooks.Open(Path.Combine(l\_s\_SourcePath, l\_s\_SourceFileName), UpdateLinks:=False, ReadOnly:=True, CorruptLoad:=1)
And here is why you NEVER USE EXCEL (or any office product) in a production environment. You are going to have to sort out your versioning of the office product (rinse and repeat every time the is a new office version) so all systems are using the same version. OR use a more robust transport method/tool.
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP