Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default After dismissing getsaveasfilename dialog, my userform becomes inactive

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default After dismissing getsaveasfilename dialog, my userform becomes inactive

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
"Ramana" wrote in message
...
| 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
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default After dismissing getsaveasfilename dialog, my userform becomes inactive

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

"Jim Rech" wrote in message
...
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
"Ramana" wrote in message
...
| 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
|
|




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default After dismissing getsaveasfilename dialog, my userform becomes inactive

Hi Jim,
Thanks for the help.
I got the mistake. It's working fine now.
The problem is 'Show Modal' property of the user form is set to false and I
am displaying the form as model using
myForm.Show VbModal
I not sure about the different between setting the property and using Show
method with 'VbModal' as the argument.

After setting the form's 'ShowModal' property to true, it is working fine.

Thanks again for the help

-Ramana

"Jim Rech" wrote in message
...
Still I am able access the worksheet cells after dismissing the
getsaveasfilename dialog.


Are you sure? The form remains modal when I run the posted code. And I
tried Excel 97 through Excel 2003. Try the attached.


--
Jim
"Ramana" wrote in message
...
| 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
|
| "Jim Rech" wrote in message
| ...
| 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
| "Ramana" wrote in message
| ...
| | 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
| |
| |
|
|
|
|





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with getsaveasfilename Jo Excel Discussion (Misc queries) 2 June 5th 07 12:41 AM
Switch focus to inactive userform GrahamUNC Excel Programming 2 April 15th 05 09:37 PM
GetSaveAsFileName Greg Hadrych Excel Programming 1 July 29th 04 12:52 AM
GetSaveAsFilename Anand Attavane Excel Programming 2 October 22nd 03 01:21 AM


All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"