Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default Hide Command button - still use it

I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.

If I hide it, I am unable to use it.

Is it possible?

Regards,
Madiya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Hide Command button - still use it

Hi
If the command is on a toolbar simply comment out the code that adds
it to the toolbar (maybe in the Workbook Open macro of your AddIn?).
Distribute this version of the AddIn to your users.
regards
Paul

On Mar 5, 12:09*pm, Madiya wrote:
I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.

If I hide it, I am unable to use it.

Is it possible?

Regards,
Madiya


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default Hide Command button - still use it

On Mar 5, 5:39*pm, wrote:
Hi
If the command is on a toolbar simply comment out the code that adds
it to the toolbar (maybe in the Workbook Open macro of your AddIn?).
Distribute this version of the AddIn to your users.
regards
Paul

On Mar 5, 12:09*pm, Madiya wrote:



I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.


If I hide it, I am unable to use it.


Is it possible?


Regards,
Madiya- Hide quoted text -


- Show quoted text -


This button is on user form.
Any other thoughts?
Regards,
Madiya
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Hide Command button - still use it

Hi
As part of the macro that runs from the button, ask for a password.
Insert

pw = inputbox("Password required")
If pw = "mypassword" then
'run rest of sub
end if

not as elegent as hiding the button but easier.
regards
Paul

On Mar 5, 1:20*pm, Madiya wrote:
On Mar 5, 5:39*pm, wrote:





Hi
If the command is on a toolbar simply comment out the code that adds
it to the toolbar (maybe in the Workbook Open macro of your AddIn?).
Distribute this version of the AddIn to your users.
regards
Paul


On Mar 5, 12:09*pm, Madiya wrote:


I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.


If I hide it, I am unable to use it.


Is it possible?


Regards,
Madiya- Hide quoted text -


- Show quoted text -


This button is on user form.
Any other thoughts?
Regards,
Madiya- Hide quoted text -

- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Hide Command button - still use it

You can give one and the same button "hidden" functions by using in
addition the keyboard when clicking it.
for example the hidden sheet is only shown when you press the shift
key while clicking the button (or may be the Ctrl key).

the VBA code for that is relatively simple:

Option Explicit
'-------------------------------
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey
As Long) As Integer
'-------------------------------
Function Key_pressed(key_to_check As Long) As Boolean
If GetAsyncKeyState(key_to_check) And &H8000 Then
Key_pressed = True
Else
Key_pressed = False
End If
End Function
'----------------------------
Sub Button1_Click()
If Key_pressed(vbKeyControl) Then ' alternatively use the
"vbKeyShift" constant for the shift key
' do something special, unhide hidden sheet or show the
worksheets from an add-in
ThisWorkbook.IsAddin = False
ThisWorkbook.Activate
Else
' here comes the standard functionality when clicking Button1
without pressing the Ctrl key at the same time
' ....
End If
End Sub


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Hide Command button - still use it

It's not very transportable, but I hide/unhide stuff based on my
username.

If Environ("username") = "myUserName" Then do something.
I have two PC's with different usernames, and so have to check for
both names.

If you used a common name like "user", then you can check for your
specific PC with
If Environ("computername")="yourPCsName" then do something.

Carl.

On Mar 5, 6:09*am, Madiya wrote:
I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.

If I hide it, I am unable to use it.

Is it possible?

Regards,
Madiya

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default Hide Command button - still use it

On Mar 5, 8:29*pm, Carl Hartness wrote:
It's not very transportable, but I hide/unhide stuff based on my
username.

If Environ("username") = "myUserName" Then do something.
I have two PC's with different usernames, and so have to check for
both names.

If you used a common name like "user", then you can check for your
specific PC with
If Environ("computername")="yourPCsName" then do something.

Carl.

On Mar 5, 6:09*am, Madiya wrote:



I have a command button in addin which when clicked, shows the data on
a very hidden sheet.
I want to hide this button so that users can not see or use them.
At the same time I want to use it myself as and when required for
cross checking the data.


If I hide it, I am unable to use it.


Is it possible?


Regards,
Madiya- Hide quoted text -


- Show quoted text -



Sorry for delay in reply since I was out of office.
Mini Master,
Thanks for your help.
This is exactly what I wanted.

Carl,
Thanks but this not going to be usefull as I am taking the users
machine on remot due to which user name remains the same while I start
debuging.
But still thanks for trying to help me out.


Regards,
Madiya
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
Hide Command button on close Tammy H Excel Programming 1 October 18th 07 11:49 PM
Using Command Button to Hide Columns in another worksheet AndrewJ[_2_] Excel Programming 2 September 14th 06 05:06 AM
Hide command button MarcoR Excel Programming 2 May 12th 06 05:31 PM
how do you hide a forms command button Paul James[_3_] Excel Programming 4 September 5th 03 06:18 PM
Hide command button on worksheet Mohair Excel Programming 3 July 14th 03 11:06 PM


All times are GMT +1. The time now is 06:30 PM.

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

About Us

"It's about Microsoft Excel"