Problem when opening an excel book through VBA

4

I have an Excel with a UserForm , from which using a CommandButton I open another Excel file by:

Workbooks.Open Filename:= "XXXX.xlsx"

The book opens it to me well, but I can not edit it and the most serious thing, I can not even close it.

I have tried to use the property of ReadOnly := False , in the call to .Open and it remains the same. I have tried to change all the options of the Excel trust center to allow the editing of everything and lower the security to the minimum if that were the problem, but everything remains the same.

The thing is that if I stop the macro or close the UserForm I can edit and do what I want with the open book.

I have even tried to put a DoEvents right after opening the book in case the form was left doing its things, but nothing at all.

Any idea how to solve it?

pd: Office version 2016 home and businesses, legal and activated.

    
asked by Oscar Carrasco 06.10.2016 в 11:35
source

1 answer

0

Del comment of the OP

  

I have already solved it, apparently when opening the form in "modal" mode it does not allow to interact with the open books.

    
answered by 13.04.2017 в 15:00