cancel
Showing results for 
Search instead for 
Did you mean: 

Error when opening excel files

MayankGoyal2
Level 8
Hi,
There are some excel files that we have to use in our automation, however it gives error when opening these files. Manually as well we get these popups and have to accept it.

1) "We found a problem with some content....... Do you want us to try to recover......." - with Yes and No button
2) "The file format and extension don't match....file could be corrupted......." - with Yes, No and Help button


Please suggest if there a way to handle this in Macro when opening workbook. We currently use - Workbooks.Open(fileName:=rawfile, UpdateLinks:=False) but this wont work with these popups.

When using Application.DisplayAlerts = False, the popup wont come but Workbooks.Open throws an error and code goes to recovery block.

I am looking for a way to open workbook and take care of all such popups

I have complete excel logic in a macro and running macro from blue prism



------------------------------
Mayank Goyal
------------------------------
2 REPLIES 2

Hi Mayank,

Need some more information to understand deeply.

1.Which excel version you are using ?
2.what is the Average excel file size ?
3.Is lot of formula used in that workbook?
4.Have you try with same automation in other workbook ( Copy data in fresh workbook, save it  and try it )
5.Have you turn off protected mode ?

Thanks
Nilesh

------------------------------
Nilesh Jadhav
Senior RPA Specialist
------------------------------
Nilesh Jadhav.
Consultant
ADP,India

Hi,
I dont have option of changing excel as its coming from a system.
It has multiple tabs and some formula as well
The size of excel is not big, hence thats not a problem.
The problem is file is xls and it gives that warning popup when opening manually as well, if we click yes, it opens. Our machines has latest version of excel.
I have to open that same file with automation and pick up some data from that file, however this pop up is blocking it and Macro goes into error at line Workbooks.open
Workbooks.open works very smoothly in other automations, we used it lot in macros
What I am looking for is if there is a specific line of code in macros that opens such excel handling these popups.

------------------------------
Mayank Goyal
------------------------------