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

[µo°Ý] µøµ¡¸ÑªR«×ªº°ÝÃD

[µo°Ý] µøµ¡¸ÑªR«×ªº°ÝÃD

  1. Private Sub Workbook_Open()
  2.      SetXLResolution
  3. End Sub


  4. Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  5. Public Const SM_CXSCREEN = 0
  6. Public Const SM_CYSCREEN = 1


  7. Sub SetXLResolution()
  8. Dim VWidth As Integer
  9. Dim VHeight As Integer
  10. ' °ª¼e¦Û°Ê³]¬°¿Ã¹õ¤j¤pªº 80%
  11. VWidth = GetSystemMetrics(SM_CXSCREEN)
  12. VHeight = GetSystemMetrics(SM_CYSCREEN)

  13. With Excel.Application
  14.      .WindowState = xlNormal ' ¥ý±Nµ¡¤fÁÙ­ì
  15.      .Width = VWidth * 0.8 * 0.75 ' Points (~ 0.75 pixels)
  16.      .Height = VHeight * 0.8 * 0.75
  17.      .Left = VWidth * 0.1 * 0.75
  18.      .Top = VHeight * 0.1 * 0.75
  19. End With
  20. End Sub
½Æ»s¥N½X
¬Yºô¯¸ªº¤@½g¤å³¹¡I
http://www.officefans.net/cdb/viewthread.php?tid=76420

¦ý¬O¦³¨â­Ó°ÝÃD
VBA ¤£Åý
  1. Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  2. Public Const SM_CXSCREEN = 0
  3. Public Const SM_CYSCREEN = 1
½Æ»s¥N½X
³o¤@¬q©ñ¦b End «á­±¡I
´N³s Workbook_open ¤]»¡¿ù»~¡I

³Ì«e­±¨º¤@¬q code ¬O©ñ¦b thisworkbook ¨S¦³¿ù§a¡I

¤£¦n·N«ä¡A§Ú¸ÑÄÀ²M·¡¤@ÂI
¦³¨â­ÓÂI¡G
²Ä¤@¡B§Ú¶}±Ò Excel ªº®É­Ô¡A¦]¬°¤º«Ø­I´º¹Ï¡A¦ý§Ú¬O¥Î 1920x1080 ³]­pªº¡A¦ý¬O´«¤@¥x¹q¸£´N·|¿Ã¹õ¤Ó¤j¡I
²Ä¤G¡B¦P¼Ëªº¨Æ±¡¤]µo¥Í¦bªí³æ~~~~

³o¨â­Óµøµ¡¤j¤p¥i¥H¨Ì¾Ú¨Ï¥ÎªÌªº¸ÑªR«×°µ½Õ¾ã¶Ü¡H

TOP

¦^´_ 2# bowwow1975
  1. Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  2. Public Const SM_CXSCREEN = 0  '³]¸m¤½¦@±`¼Æ¡A¨ú±o¿Ã¹õ¸ÑªR«×ªºX­È
  3. Public Const SM_CYSCREEN = 1  '³]¸m¤½¦@±`¼Æ¡A¨ú±o¿Ã¹õ¸ÑªR«×ªºY­È
½Æ»s¥N½X
³o¬qµ{¦¡½XÀ³¸Ó©ñ¦b¤@¯ë¼Ò²Õ¤º¡A¦]¬°¤½¦@±`¼Æ¥u¯à©ñ¦b¤@¯ë¼Ò²Õ
¥H¤U¬°Thisworkbook¼Ò²Õµ{¦¡½X
  1. Private Sub Workbook_Open()
  2. VWidth = GetSystemMetrics(SM_CXSCREEN) '¨ú±o¿Ã¹õ¸ÑªR«×ªºX­È
  3. VHeight = GetSystemMetrics(SM_CYSCREEN) '¨ú±o¿Ã¹õ¸ÑªR«×ªºY­È
  4. With Excel.Application
  5. 'VWidth / 1960±o¨ì»P­ì³]­p¸ÑªR«×X­Èªº¤ñ¨Ò
  6. 'VWidth / 1080±o¨ì»P­ì³]­p¸ÑªR«×Y­Èªº¤ñ¨Ò

  7.      .WindowState = xlNormal ' ¥ý±Nµ¡¤fÁÙ­ì
  8.      .Width = VWidth * (VWidth / 1960) * 0.75 ' Points (~ 0.75 pixels)
  9.      .Height = VHeight * (VHeight / 1080) * 0.75
  10.      .Left = 0
  11.      .Top = 0
  12. End With
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¨t²Î»¡¨S¦³©w¸q³o­Ó Sub ©Î Function.

§Ú¬OÂIÀ» Thisworkbook ´¡¤J¼Ò²Õ¡AµM«á¦b Module1 ¶ñ¼g¤W­±¨º¤@¬q¡I

TOP

¥»©«³Ì«á¥Ñ bowwow1975 ©ó 2012-8-16 09:35 ½s¿è

¦n¹³¬O«ü GetSystemMetrics ³o­Ó©w¸q¡H

¦pªG¤£¦æªº¸Ü¡A¥i¯à´N±o¥þ³¡§ï¦¨ 800x600 ªº¡A¦Ü¤Ö¤j®a³£¥i¥H¥Î¡I

TOP

¸ÕµÛ§ï¦¨³o¼Ë¤]¤£¦æ¡I
  1. Private Sub Workbook_Open()
  2. SetXLResolution
  3. End Sub
  4. Sub SetXLResolution()
  5. Dim VWidth As Integer
  6. Dim VHeight As Integer
  7. VWidth = GetSystemMetrics(SM_CXSCREEN) '¨ú±o¿Ã¹õ¸ÑªR«×ªºX­È
  8. VHeight = GetSystemMetrics(SM_CYSCREEN) '¨ú±o¿Ã¹õ¸ÑªR«×ªºY­È
  9. With Excel.Application
  10. 'VWidth / 1960±o¨ì»P­ì³]­p¸ÑªR«×X­Èªº¤ñ¨Ò
  11. 'VWidth / 1080±o¨ì»P­ì³]­p¸ÑªR«×Y­Èªº¤ñ¨Ò

  12.      .WindowState = xlNormal ' ¥ý±Nµ¡¤fÁÙ­ì
  13.      .Width = VWidth * (VWidth / 1960) * 0.75 ' Points (~ 0.75 pixels)
  14.      .Height = VHeight * (VHeight / 1080) * 0.75
  15.      .Left = 0
  16.      .Top = 0
  17. End With
  18. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# bowwow1975

play.gif

TOP

·PÁÂ~~~ It is work now¡I

ÁöµM­ì©l½Xªºµ²ªG©M§Ú·Qªº¤£¤@¼Ë¡I
ªí³æÁÙ¬O¤@¼Ë¤j¡AExcel ¥u¬O§ó§ïµøµ¡¤j¤p¡A¤º®eÁÙ¬O¤@¼Ë¶W¥Xµøµ¡¡I¡I

¤£¹L¤w¸gÅý§Ú¾Ç¨ì¤@¨ÇªF¦è¤F¡A·PÁ¦U¦ì¤j¤jÀ°¦£¡I

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD