ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð¦U¦ì¥ý¶i¡A¦p¦ó¸T¥Îview code¥\¯à¡H

[µo°Ý] ½Ð±Ð¦U¦ì¥ý¶i¡A¦p¦ó¸T¥Îview code¥\¯à¡H

¥»©«³Ì«á¥Ñ mmxxxx ©ó 2014-11-12 09:09 ½s¿è

¼¶¼gSPC xBar & R Chartµ{¦¡¡A¨Ï¥ÎExcel VBA,
Excelµe­±ªºRibon,ª¬ºA¦C...§¡Âð_¨Ó¡A¥u³Ñsheet-tab¤Î¼ÐÃD.
¬°«OÅ@µ{¦¡½X¡A¤]¥[±K½X¡A¤u§@ªí¥kÁä¤]Âê¦í¡A
¦ý¤´µLªkªý¤îAlt-F11 ¤Î¦bSheet-tab¤W«ö¥kÁ䪺View Code¶i¤JVBE.
¦³¦ó¤èªk¥iªý¤î¡A¤£Åý¨Ï¥ÎªÌµLªk¶i¤JVBE.

·PÁ¡C

¦^´_ 1# mmxxxx
¬°«OÅ@µ{¦¡½X¡A¤]¥[±K½X ¬O³o¼Ë°µ¶Ü?

·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¬Oªº, ¥[±K¦³³]©w.
¦p¦ó¤£ÅýVBEªºÀô¹Ò, ¥i¥H¶i¤J.
google¬d¨ìªº¤èªk, ¸Õ¤£¥X¨Ó.
¦p¤U½Ð°Ñ¦Ò.
'// Run DisableGettingIntoVBE from a Event procedure
'// eg. Workbook_Open or Worksheet_Activate

'// THEN run EnableGettingIntoVBE from the Opp Event procedure
'// eg. Workbook_Close or Worksheet_Deactivate

Sub DisableVBE()
   Application.VBE.MainWindow.Visible = False '// Close ALL windows 1st!
   CmdControl 1695, False                     '// Visual basics Editor
   CmdControl 186, False                      '// Macros...
   CmdControl 184, False                      '// Record New Macro...
   CmdControl 1561, False                     '// View Code
   CmdControl 1605, False                     '// Design Mode
   Application.OnDoubleClick = "Dummy"
   CommandBars("ToolBar List").Enabled = False
   Application.OnKey "%{F11}", "Dummy"
End Sub

Sub EnableVBE()
   CmdControl 1695, True                    '// Visual basics Editor
   CmdControl 186, True                     '// Macros...
   CmdControl 184, True                     '// Record New Macro...
   CmdControl 1561, True                    '// View Code
   CmdControl 1605, True                    '// Design Mode
   Application.OnDoubleClick = ""
   CommandBars("ToolBar List").Enabled = True
   Application.OnKey "%{F11}", ""
End Sub

Sub CmdControl(Id As Integer, TF As Boolean)
  Dim CBar As CommandBar
  Dim C As CommandBarControl
  On Error Resume Next
  For Each CBar In Application.CommandBars
    Set C = CBar.FindControl(Id:=Id, recursive:=True)
    If Not C Is Nothing Then C.Enabled = TF
  Next
End Sub

Sub Dummy()
    '// NoGo, leave blank OR Display a message eg.
    'MsgBox "Sorry you this command is NOT available", vbCritical
End Sub

TOP

¦^´_ 3# mmxxxx
¬°«OÅ@µ{¦¡½X¡A¤]¥[±K½X
§Aªº·N«ä¬O¥i¥H¶i¤J¬d¬Ý³o¥[±KªºVBAProjectµ{¦¡½X?
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE

¤j¤j, §Úªí¹Fªº¤£°÷²M·¡.
§Úªº·N«ä¬O, ¥Ø«e¨Ï¥Î±K½X«OÅ@VBAProject¤º®e.
¦ý«Ü§Ö§Y³Q¯}¸Ñ.

·Q·Q, ³Ì¦nªº¤èªk, ¬O¤£¤¹³\¶i¤JVBEªº·N«ä.

TOP

¦^´_ 5# mmxxxx
Å]°ª¤@¤V°Ú
¦³¿ìªk¯}¸Ñ±K½X«OÅ@VBAProject¤º®e.
·|¨S¿ìªk,¶i¤JVBAµøµ¡¶Ü?
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD