The modal form you are trying to close or hide isn't on top of the z-order. This error has the following cause and solution:
First use either the Unload statement or the Hide method on any modal form higher in the z-order. A modal form is a form displayed by the Show method, with the style argument set to 1 – vbModal.