After dismissing getsaveasfilename dialog, my userform becomes inactive

R

Ramana

Hi,
My Add-In I am opening a user form displayed as modal dialog on clicking a
toolbar button.
From this form, on a button click, I am opening 'GetSaveAsFileName' dialog
to get the file name from user.
After dismissing the dialog, the userform becomes inactive and I am able to
select cells on the active worksheet.
Is this a known issue with Microsoft?
Is there any solution to activate my form and restrict the user from
accessing worksheet.

Regarding restricting access to worksheet, I am able to restrict the user
access by setting the application.interactive property to false.
But with this setting, I am not able to display the userform if I select
multiple sheets before displaying the dialog. I am getting the following
error.

Runtime error 1004,
Method 'Interactive' of object '_Application' failed.

Advance Thanks for help
-Ramana
 
J

Jim Rech

This approach may help:

Private Sub CommandButton1_Click()
Dim FN As Variant
Me.Hide
FN = Application.GetOpenFilename("Excel file,*.xls")
Me.Show
End Sub


--
Jim
| Hi,
| My Add-In I am opening a user form displayed as modal dialog on clicking a
| toolbar button.
| From this form, on a button click, I am opening 'GetSaveAsFileName' dialog
| to get the file name from user.
| After dismissing the dialog, the userform becomes inactive and I am able
to
| select cells on the active worksheet.
| Is this a known issue with Microsoft?
| Is there any solution to activate my form and restrict the user from
| accessing worksheet.
|
| Regarding restricting access to worksheet, I am able to restrict the user
| access by setting the application.interactive property to false.
| But with this setting, I am not able to display the userform if I select
| multiple sheets before displaying the dialog. I am getting the following
| error.
|
| Runtime error 1004,
| Method 'Interactive' of object '_Application' failed.
|
| Advance Thanks for help
| -Ramana
|
|
 
R

Ramana

Hi Jim,
Still I am able access the worksheet cells after dismissing the
getsaveasfilename dialog.
Also I am not getting the focus rectangle on the button even after calling
setfocus method.

Thanks,
Ramana
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top