Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Changing control Panel options

Hello:

I was wondering how I can write a VBA code that will allow me to change the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me know.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Changing control Panel options

Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" wrote in message
...
Hello:

I was wondering how I can write a VBA code that will allow me to change
the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me
know.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Changing control Panel options

Function DefMouseButton(Optional nButton As Long = 0)

better as

Function DefMouseButton(Optional nButton As Long = 0) As Long

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" wrote in message
...
Hello:

I was wondering how I can write a VBA code that will allow me to change
the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me
know.

Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Changing control Panel options

Thanks. What I wanted was the window "C:\Windows\system32\main.cpl" that is
the mouse option window to display. Can you tell me how to write that.

"Peter T" wrote:

Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" wrote in message
...
Hello:

I was wondering how I can write a VBA code that will allow me to change
the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me
know.

Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Changing control Panel options

Thanks, I got already what I wanted:

Sub OPenMousenow()
Set ShellApp = CreateObject("Shell.Application")
ShellApp.ControlPanelItem ("C:\Windows\system32\main.cpl")
End Sub





Thanks Anyways.

"Peter T" wrote:

Function DefMouseButton(Optional nButton As Long = 0)


better as

Function DefMouseButton(Optional nButton As Long = 0) As Long

Peter T

"Peter T" <peter_t@discussions wrote in message
...
Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" wrote in message
...
Hello:

I was wondering how I can write a VBA code that will allow me to change
the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me
know.

Thanks.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Changing control Panel options

Call Shell("rundll32.exe shell32.dll,Control_RunDLL main.cpl @0",
vbNormalFocus)

Regards,
Peter T

"art" wrote in message
...
Thanks. What I wanted was the window "C:\Windows\system32\main.cpl" that
is
the mouse option window to display. Can you tell me how to write that.

"Peter T" wrote:

Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" wrote in message
...
Hello:

I was wondering how I can write a VBA code that will allow me to change
the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me
know.

Thanks.






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
Linking dats on a worksheet to control panel sbearman Charts and Charting in Excel 0 June 25th 08 01:35 PM
Modify language options from control panel using VBA Alex St-Pierre Excel Programming 2 January 21st 07 02:50 PM
Control panel detection Jags Excel Programming 2 February 14th 06 12:36 PM
Control Panel-Dual Display API Vacation's Over Excel Programming 2 September 18th 05 07:37 PM
Control Panel Matt Excel Programming 1 March 22nd 05 07:01 PM


All times are GMT +1. The time now is 01:52 AM.

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"