Hi all, I have a vba code that opens xls files and does various things then close the xls file not saving it.
The code used to work fine in excel 2003-2007 but in excel 2016 I receive an error like this "run time error 2147021892 800070bbc".
From what I understand excel 2016 wants to open the xls files in protected view or with a button to enable editing. But how can I bypass this runtime error and open the xls anyway?
I have tried to change setting in the trust center, I have disable almost all controls and still nothing.
The code is very simple and, as I said, used to work fine:
Any ideas or suggestions would be most appreciated!!!
Son
The code used to work fine in excel 2003-2007 but in excel 2016 I receive an error like this "run time error 2147021892 800070bbc".
From what I understand excel 2016 wants to open the xls files in protected view or with a button to enable editing. But how can I bypass this runtime error and open the xls anyway?
I have tried to change setting in the trust center, I have disable almost all controls and still nothing.
The code is very simple and, as I said, used to work fine:
VBA Code:
fName = Dir("*.xls")
Do While Len(fName) > 0
If fName <> ThisWorkbook.Name And fName <> "0000.xls" And Len(fName) < 17 Then
Workbooks.Open fName
....
ActiveWorkbook.Close False 'make this TRUE of you want to save the changes made to the wb opened
End If
fName = Dir 'next file
Loop
Any ideas or suggestions would be most appreciated!!!
Son