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

sleep°ÝÃD¡H

¦^´_ 1# joey0415
¸Õ¸Õ¬Ý¡I
®t§O¦b©ó Long ¤Î LongLong ªº«Å§i«¬ºA¡C
  1. #If VBA7 And Win64 Then
  2.        ' 64 bit Excel
  3.        Public Declare Sub Sleep Lib "kernel32" ( _
  4.            ByVal dwMilliseconds As LongLong)
  5. #Else
  6.       ' 32 bit Excel
  7.      Public Declare Sub Sleep Lib "kernel32" ( _
  8.          ByVal dwMilliseconds As Long)
  9. #End If

  10. Sub Test()
  11.       Sleep NumberOfSeconds * 1000
  12. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# Hsieh
¦^´_ 3# joey0415
­ì¨Ó¦p¦¹¡A ¨ü±Ð¤F¡I Âà­z¦p¤U¡G
  1. Declare Function RegOpenKeyA Lib "advapi32.dll" (ByVal Key As Long, ByVal SubKey As String, NewKey As Long) As Long
½Æ»s¥N½X
¦b Microsoft Visual C ©M Microsoft Visual C++ ¤¤¡A«e¤@½d¨Ò·|¦P®É¥¿½T¦a½sĶ 32 ¦ì¤¸©M 64 ¦ì¤¸¡C³o¬O¦]¬° HKEY ·|©w¸q¬°«ü¼Ð¡A
¨ä¤j¤p¤Ï¬Mµ{¦¡½X½sĶ©Ò¦b¤§¥­¥xªº°O¾ÐÅé¤j¤p¡C
¦bª© VBA ¤¤¡A¨Ã¨S¦³¯S©wªº«ü¼Ð¸ê®ÆÃþ«¬¡A¦]¦¹·|¨Ï¥Î Long ¸ê®ÆÃþ«¬¡C¦¹¥~¡A¥Ñ©ó Long ¸ê®ÆÃþ«¬¤@«ß¬° 32 ¦ì¤¸¡A
¦]¦¹¦b¨ã¦³ 64 ¦ì¤¸°O¾ÐÅ骺¨t²Î¤W¨Ï¥Î®É¡A·|¦]¬°ºIÂ_¤W¤è 32 ¦ì¤¸©Î½Æ¼g¨ä¥L°O¾ÐÅé¦ì§}¦Ó·l·´¡C
³o¨Ç±¡ªp·|¾É­PµLªk¹w´Áªº¦æ¬°©Î¨t²Î·í¾÷¡C
¬°¤F¸Ñ¨M³o­Ó°ÝÃD¡AVBA ²{¦b¥]§t¥¿½Tªº¡u«ü¼Ð¡v¸ê®ÆÃþ«¬¡GLongPtr¡C¦¹·s¸ê®ÆÃþ«¬¥iÅý±z¥¿½T¦a¼g¤J­ì©l Declare ³¯­z¦¡¡A¦p¤U©Ò¥Ü¡G
  1. Declare PtrSafe Function RegOpenKeyA Lib ¡§advapire32.dll¡¨ (ByVal hKey as LongPtr, ByVal lpSubKey As String, phkResult As LongPtr) As Long
½Æ»s¥N½X
¦¹¸ê®ÆÃþ«¬©M·sªº PtrSafe ÄÝ©Ê¥iÅý±z¦b 32 ¦ì¤¸©Î 64 ¦ì¤¸¨t²Î¤W¨Ï¥Î¦¹ Declare ³¯­z¦¡¡C
PtrSafe ÄÝ©Ê·|¦V VBA ½sĶ¾¹«ü¥Ü Declare ³¯­z¦¡¬O°w¹ï 64 ¦ì¤¸ª©¥»ªº Office 2010¡C¦pªG¨S¦³¦¹ÄÝ©Ê¡A
¦b 64 ¦ì¤¸¨t²Î¤¤¨Ï¥Î Declare ³¯­z¦¡·|¾É­P½sĶ®É´Á¿ù»~¡C½Ðª`·N¡APtrSafe Äݩʦb 32 ¦ì¤¸ª©¥»ªº Office 2010 ¤W¬°¿ï¥Î¡C
³oÅý²{¦³ªº Declare ³¯­z¦¡¥i¦p©¹±`¯ë¹B§@¡C

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD