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

Office 2000 VBA ªºbug?

Office 2000 VBA ªºbug?

¦U¦ì¤j­ô¦n¡G

­ì¥»§Ú¨Ï¥Îªº¬O2000ª©¥»ªºOffice¡AµL½×«ç»òdeBugÁ`¬O¥X²{¡u«¬ºA¤£²Å¦X¡vªºError¡A

«á¨Óµo²{2013ª©¥»ªºOffice¥i¥H°õ¦æ¡A§¹¥þ¤£·|²£¥Í¦¹°ÝÃD¡A
©Ò¥Hª½±µ®¿¨ì¦³Äé2013ªº¹q¸£¥h¥Î¤F¡A¦ýÁÙ¬O¤Q¤À§x´b2000ª©¥»¨ì©³¦³¤°»òBug¡C

°ÝÃD¬O³o¼Ëªº¡A
§Ú§âÀx¦s®æ¥ÎVBAŪ¶i¤@­Ó 6668x4 ªº°}¦C­n³B²z¡]¦p¤U¹Ï¡^¡A­n±N¨ä¤¤¤@¦æµÑ¨ú¥X¨Ó¡A¦¨¬°¤@­Ó¤@ºû°}¦C¡]6888­Ó¤¸¯À¡^
§Ú¨Ï¥Î Application.WorksheetFunction.Max ¨ç¼Æ¥h§ä³o­Ó¤@ºû°}¦Cªº³Ì¤j­Èªº®É­Ô¡A§ä³Ì¤j­È³o¦æ§¹¥þµLªk°õ¦æ¡C
¦ý¬O¨ä¥Lµ{¦¡½X³£¥i¥H°õ¦æ¶¶§Q¡A
¹ê¦b§ä¤£¥X­ì¦]¤§¤U¡A§Ú±N±±¨î½d³òªºµ{¦¡½X§ï¦¨¤@­Ó 100x4 ¤j¤pªº°}¦C¡Aµ²ªG°õ¦æ§¹¥þ¥¿±`¡I
§Ú¥u¬O­×§ï¤F°}¦Cªºªø«×¡A¨Ã¨S¦³­×§ï¨ä¥Lªº¤º®e¡C



§Ú­n³B²zªº¨º­Ó¤@ºû°}¦C(6668x1)¥u¬Oªø«×«Ü¤j¡A¬Ý°_¨Ó¨S¤°»ò¤£¦P¡A
¨Ï¥Î¨ä¥L¨ç¦¡¡]UBound/­Ó¼Æ¤W­­¡B³Ì¥½¤¸¯À­Èµ¥µ¥¡^¥hŪ¨ú¨ä¯S©Ê¤]³£¥¿±`¡A©Ò¥H§Úªºinput±ø¥óÀ³¸Ó¬O¹q¸£»{±oªº
°ß¿W´N¬O³Ì¤j³Ì¤p­Èªº¥\¯à¤£¯à¨Ï¥Î

«á¨Ó¤£¦º¤ß¡A±N°}¦C§ï¦¨ 6000x1 ¤j¤p¡Aµ²ªG¤]¥X²{¦P¼Ëªº¿ù»~«¬ºA¡A
±N°}¦C§ï¦¨ 5000x1 ¤j¤p¡A©_Âݵo¥Í¤F¡I©Ò¦³µ{¦¡½X¤S¥i¥H¶¶§Q°õ¦æ¤F¡I

«Ü¦n©_¨ì©³¬O±q¦h¤Ö¶}©l·|¦³Errorªº¡A«á¨Ó³Q§Ú¸Õ¥X¡A¥u­n°}¦C¬O 5461x1 ¤j¤p¥H¤U¡A¦¹¨ç¦¡ Application.WorksheetFunction.Max  ³£¥i°õ¦æ
5462x1 ¤j¤p¥H¤W¡A¦¹¨ç¦¡ªº¥\¯à´N·|¥X²{Error¡A¿ù»~¤º®e¬°¡u«¬ºA¤£²Å¦X¡v¡C
2013ª©¥»ªºOffice¨S¦³³oª¬ªp³á¡I



PS.§Ú§âµ{¦¡½X¶K¦bªþ¥ó¤F¡A¯à§_½Ð¦U¦ì¤j¤j¸Ñµª¦¹ºÃ´b

Trial_array.zip (302.89 KB)

«ü©w¤Gºû°}¦Cªº¬Y¤@¦æ¨ì¤@ºû°}¦C

­«¶Kµ{¦¡½X
  1. Sub AllCol(theArray As Variant, ColNum As Integer, ByRef mArr() As Double) '¶Ç¤J¤Gºû°}¦C¡A¶Ç¥X¤@ºû°}¦C

  2.     Dim s, j

  3.     s = 0 'ªì©l¤Æs
  4.      For j = 1 To UBound(theArray, 1) '¸Ó¤Gºû°}¦Cªº¦C¼Æ(«D¦æ¼Æ)¤W­­
  5.          
  6.          ReDim Preserve mArr(s) '­«·s©w¸q¤@ºû°}¦C¤j¤p
  7.          
  8.          mArr(s) = theArray(j, ColNum)
  9.          s = s + 1
  10.      Next j
  11.      

  12. End Sub

  13. Sub Ellipse1_Click()

  14. Dim T() As Variant
  15. Dim A() As Double
  16. Dim B() As Double

  17. Dim i, j

  18. T = Range("A1:D5461")

  19. Call AllCol(T, 1, A) '«ü©w¤Gºû°}¦CTªº²Ä1¦æ¬°¤@ºû°}¦CA


  20. For i = 0 To UBound(A)
  21.      ReDim Preserve B(i)
  22.      B(i) = (-1) * A(i)
  23. Next i
  24. '¦¹for°j°é§@¥Î¡G±N¤@ºû°}¦CAÂন[-A]


  25. Range("H1") = UBound(B) '±N¤@ºû°}¦CBªº­Ó¼Æ¦L¦bH1Àx¦s®æ
  26. Range("H2") = B(UBound(B)) '±N¤@ºû°}¦CBªº³Ì¥½¤¸¯À¦L¦bH2Àx¦s®æ
  27. Range("H3") = Application.WorksheetFunction.Max(B) '±N¤@ºû°}¦CBªº³Ì¤j­È¦L¦bH3Àx¦s®æ

  28. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# Delphia
¥Î2003´ú¸Õ¤]¨S°ÝÃDªº.
¶·½Ð2000´ú¸Õ¬Ý¬Ý.
©Î­«ÄéOFFICE 2000¸Õ¸Õ.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# Delphia
¥u¬O²q测¤@¤U¡G
office2000ªºVBA¬O¥H16¦ì内®Ö编译ªº(Windows 98¨t统¦C),©Ò¥H¥¦内³¡ªº变¶q¬O¤£¬Oª½±µ´N¬O¥H双¦r节长«×ªº变¶q来处²z数组ªº¤W¤U标«H®§¡A©Ò¥H¤j¤_65535ªº数Õu处²z¤£¤F¡A¦ÓOffice2003¥H¤Wªº¬O¥H双¦r(¥|¦r节)来处²z¡A©Ò¥H¤£会¥X错¡C
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

ÁöµM¨Ï¥ÎVBA¹Bºâ¡A¦ý¤´ÄÝ¡e¤u§@ªí¨ç¼Æ¡f¡A
¤£¥u MAX¡A¨ä¥¦ WorksheetFunction ¨ç¼Æ¤@¼Ë¨ü­­¤_¡earray °}¦C¡fªº­­¨î¡A
³¡¥÷§ï¥H Range ¬°°Ñ·Ó«h¥i¥H¥¿±`­pºâ¡]¦ý¤£¬O¥þ³¡¡^¡F
¡@
¦b¤u§@ªíÀx¦s®æª½±µ¿é¤Jªº¤½¦¡¡A¬Y¨Ç¨ç¼Æ¤@¼Ë¨ü³æ¤¸®æ¼Æ¶qªº­­¨î¡A¨Ò¦p¡GMMULT, TRANSPOSE....µ¥µ¥
OFFICE 2000¤Î¥H¤Uª©¥»¬O¦p¦¹¡A
¨ä¥¦¸û°ªª©¥»¤]À³¦U¦³¨ä­­¨î¡A¥u¬O¹ê»Ú¨Ï¥Î¤W¡A¤j¬ù¤£¤Ó·|¶W¹L¨ä¥i®e³\«×§a¡A©Ò¥H¡e¨S·Pı¡f¡H¡H¡H
¡@
¥i°Ñ¦Ò¥H¤U¡G
https://support.microsoft.com/zh-tw/kb/177991#/zh-tw/kb/177991
https://support.microsoft.com/zh-tw/kb/166342#/zh-tw/kb/166342

TOP

Excel 2010 32¦ì¤¸ª©¥»ªº WorksheetFunction ¨ç¼Æ
¦P¼Ë¨ü­­©ó 65535ªº¸ê®Æªø«×

TOP

        ÀR«ä¦Û¦b : ±o²z­nÄǤH¡A²zª½­n®ð©M¡C
ªð¦^¦Cªí ¤W¤@¥DÃD