Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General

Post new topic   Reply to topic
Disable Open option in Excel Report from VB
View previous topic :: View next topic  
Author Message
ourspt
Freshman


Joined: 14 Dec 2004
Posts: 34

PostPosted: Oct 21st, 2005 06:26 AM    Post subject: Disable Open option in Excel Report from VB Reply with quote

Hi,

How to disable open option when I right click on the excel desktop.

By using the following code, I have successfully achieved the disabling of open option from Menu bar and Toolbar.

Now I need to disable the same in the Excel desktop’s right Click.

Set mFileMenu = CommandBars.FindControl(ID:=30002) ' File Menu

If mFileMenu Is Nothing Then Exit Sub

For Each mOpenMenu In mFileMenu.Controls

If mOpenMenu.ID = 23 Then mOpenMenu.Enabled = False

Next mOpenMenu

Set mOpenMenu = Nothing

Set mFileMenu = Nothing



Set mOpenMenuToolBar = CommandBars.FindControl(ID:=23) ' Tool Bar

If mOpenMenuToolBar Is Nothing Then Exit Sub

mOpenMenuToolBar.Enabled = False

Set mOpenMenuToolBar = Nothing



We cannot lock the excel file completely, as we need some options like Print, Save As etc.

Thanks in advance
ourspt
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic