Winform form is disabled when VBA modal userform (with web browser control ) is hidden - by Chandra_12

Status : 

  Not Reproducible<br /><br />
		The product team could not reproduce this item with the description and steps provided.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 530830 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 2/4/2010 7:24:19 AM
Access Restriction Public


Having a winforms UI and VBA UI in the same application ( Excel in my case ) has problem when the VBA UI is modal and is hidden. 

I have created a Office shared .net addin or VSTO application add-in. This add-in adds a button to Office UI ( 2003, 2007... ). Clicking on the button opens a Winform UI. This UI is modeless and has button on it to hide. The instance of the UI is saved and if it is not disposed - show(-- excel window as owner -- ) is used to display it.

When there is a VBA add-in in Excel which has userform set as modal. This vba add-in also adds a button to Office Excel UI. When clicking  on the button, it opens the modal UI and there is a button on the UI to hide it. Hiding this UI, later on causes the Winform UI unresponsive to user input. 

I have used spy++ and uispy tools to view the status of the UI. The message sequence shows that the winforms UI is deactivated when there is a hidden modal vba form.

If there are only Winform UI with similar stuff ( modal and modeless mixed, with hide/show being used ) - then this problem does not happen.
If there are only VBA add-ins with userforms this problem does not happen.

This seems to happen only when VBA has webbrowser control. Here's most of the vba code:

Module code: 

Sub ShowUI()
    Load UserForm1
End Sub

Form code: 

Private Sub CommandButton1_Click()

End Sub

Private Sub UserForm_Activate()
Me.WebBrowser1.Navigate2 ""
End Sub

ThisWorkbook adds a command to the office UI:

With objCommandBarButton
                .Style = msoButtonIconAndCaption
                .TooltipText = "TESTER"
               .Picture = picPicture
                .OnAction = ThisWorkbook.Name & "!ShowUI"
               .Enabled = True
           End With
Sign in to post a comment.
Posted by Microsoft on 3/1/2010 at 4:28 PM
Since we haven't heard back regarding requested information, we will go ahead and close this issue. If you are still experiencing this problem, please either reactivate this issue or open a new one.

Thank you.

Hamed Ahmadi
VSTO Software Development Engineer
Posted by Microsoft on 2/16/2010 at 3:52 PM
The repro steps have been tried on different OS/VS/Office configs and did not repro. I will need the exact machine config (OS version, VS version/build, Office version/build) and the VBA add-in used to repro this issue to investigate more.

Hamed Ahmadi
Software Development Engineer | Visual Studio for Business Applications
Posted by Microsoft on 2/5/2010 at 12:19 AM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(