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

[Âà¶K] ¦Û­qApplicatoin¨Æ¥ó/ºÊ±±©Ò¦³¬¡­¶Ã¯/°µ¦¨¼W¯q¶°

[Âà¶K] ¦Û­qApplicatoin¨Æ¥ó/ºÊ±±©Ò¦³¬¡­¶Ã¯/°µ¦¨¼W¯q¶°

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-5-10 15:45 ½s¿è

³o­Ó¥t¦s³Æ¥÷Àɪº¨Ò¤l¡A
¬O§Q¥Î Workbook_BeforeSave ¨Æ¥ó --
http://gb.twbts.com/index.php/topic,1661.0.html

¦pªG¦³³\¦hÀɮ׳£­n¦s³Æ¥÷¡AÃø¹D¨C­ÓÀɳ£­n·Ó§@¤@¦¸¶Ü??
¤]³\¤£¤Ö¤Hª¾¹D¦³¤@³Ò¥Ã¶hªº¿ìªk¡G
¦Û­q¤@­Ó¥i¥HºÊ±±©Ò¦³¬¡­¶Ã¯ªºApplication¨Æ¥ó¡A¦A°µ¦¨¼W¯q¶°¡C

²{±N¥¦¹ê§@¹Lµ{¼g¥X¨Ó¡A¤è«K¤j®a°Ñ¦Ò¡G
1. ¶}±Ò·s¬¡­¶Ã¯¡A«ö Alt-F11 ¤Á´«¦Üµ{¦¡½s¿è¾¹¡C
2. ´¡¤J > ª«¥óÃþ§O¼Ò²Õ (¹w³]¦WºÙ¬° Class1)¡C
3. ¦¹®É·|¶}±Ò¤@­ÓªÅ¥Õªºµ{¦¡½s¿è°Ï¡A½Ð¿é¤J¥H¤Uµ{¦¡½X¡G
Public WithEvents App As Application
µù¡G App ¬O¦Û­q¦WºÙ¡C³o¥y·N«ä¬O¦Û­q¤@­Ó§t¦³¨Æ¥óªºApplicationª«¥ó¡C
4. «ö¤U Enter «á¡A½s¿è°Ï¥ª¤W¤èªºª«¥ó¿ï³æ¤¤·|¦h¥X¤@­Ó App ¡C
ÂI¿ï App¡A«h¥k¤W¤èªº¿ï³æ·|¦C¥X³o­ÓApplicationª«¥ó¥i¥Îªº¨Æ¥ó¡C
5. ¦b¥i¥Î¨Æ¥ó¤¤ÂI¿ï WorkbookBeforeSave¡A«h·|¦b½s¿è°Ï²£¥Í¤@­ÓªÅªº¨Æ¥ó¡G
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)

End Sub
¥E¬Ý«Ü¹³¤§«eºD¥Îªº Workbook_BeforeSave ¨Æ¥ó¡A®t§O´N¦b©ó Workbook_BeforeSave ¥u¯àºÊ±±µ{¦¡©Ò¦b¬¡­¶Ã¯ªº¦sÀÉ¡A¦Ó³o­Ó App_WorkbookBeforeSave ¥iºÊ±±©Ò¦³¬¡­¶Ã¯ªº¦sÀɰʧ@¡C
6. ²{¦b¥i§â¥t¦s³Æ¥÷ªºµ{¦¡½X®M¤J³o­Ó¨Æ¥ó.. ¦ý¬O­nµy§ï¤@¤U¡G
Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)
¡@¡@Wb.SaveCopyAs "C:\TEMP\" & Wb.Name
End Sub
7. ±µµÛ¦A©óµ{¦¡½s¿è¾¹¥\¯àªí ´¡¤J > ¼Ò²Õ¡A¦b·s¶}¥Xªº½s¿è°Ï¿é¤J¥H¤Uµ{¦¡¡G
Public xlApp As New Class1 '«Å§i xlApp ¬°¤W­±¦Û­qªºª«¥ó¼Ò²Õ

Sub Auto_Open() 'Auto_Open·|¦b¦¹Àɶ}±Ò®É¦Û°Ê°õ¦æ
¡@¡@Set xlApp.App = Application
¡@¡@'§â¦Û­q¼Ò²Õªº App ³]¬°(¤]¥i»¡³sµ²¨ì)Applicationª«¥ó
End Sub
OK¡Aµ{¦¡ªº³¡¤À¨ì¦¹¬°¤î¡F«ö Alt-Q Â÷¶}µ{¦¡½s¿è¾¹¡C
8. ±N¦¹Àɮצs¬° ¼W¯q¶° (°ÆÀɦW¬° XLA)¡A¨Ã¥BÃö³¬¡C
9. ÂI¿ï¥\¯àªí ¤u¨ã > ¼W¯q¶°... > ÂsÄý... ¸ü¤J­è¤~°µ¦nªº¼W¯q¶°¡C
¦n¤F¡A§A¥iÀH·N¥´¶}¨ä¥L¬¡­¶Ã¯¡B½s¿èµM«áÀx¦s¡A¸Õ¸Õ¦Û¤v°µªº¦¨ªG¡C

·íµM¡A§A¥i¦b²Ä 4¡B5 ¨BÆJ¿ï¾Ü¨ä¥L¨Æ¥ó¨Ã½s¼g§A·Q­nªºµ{¦¡¡A¨É¨ü»´ÃP¾Þ±±©Ò¦³¬¡­¶Ã¯ªº§Ö·P~

¬Ý­¾¤]³\ı±o¡G«ç»ò³o¼Ë³Â·Ðªü??
¦p¦P¤W­zªºApplicationª«¥ó¥H¤Î¤§«eÁ|¹L¤@¨Ç¨Ò¤lªº±±¨î¶µ¸s²Õª«¥óµ¥µ¥¡AOffice¦³³\¦hª«¥ó©M¨ä¨Æ¥ó¤£¬O¹w³]ªº¡A¦Ó¨Æ¥óªºµ{¦¡½X¤S¥²¶·¨Ìªþª«¥ó¼Ò²Õ¡A©Ò¥H¥²¶·¦Û­qª«¥ó¼Ò²Õ¡C³o¨Ç¨Ã«D±`¥Î¥\¯à¡A¦ýVBA¤´µM«O¯d¤F¦Û­q»P©µ¦ùªºªÅ¶¡µ¹¨Ï¥ÎªÌ --
¦Ó¥B¥u­n¾Ç·|À³¥Î¡A¥iµo´§«Ü¤jªº®Ä¯q¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

Hsieh ¥S
³oidea¤£¿ù¾Ç²ß

TOP

¥|¦~«e¼g¹L¤@­ÓÃþ¦üªºªF¦è¡A§â¡uÀx¦s¸ê°T¡v¼g¦b¡yºK­n¸ê°T¡z¸Ì­±¡A®³¥X¨Ó²{Áà¤@¤U
Excel 2007 ¤Î Excel 2010 À³¸Ó¤£¯à°õ¦æ§a¡H¡I§Ú²qªº¡I¦]¬°§ÚÁÙ¦b¥Î Excel 2003
http://blog.xuite.net/saladoil/excel/7055499
¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

¥|¦~«e¼g¹L¤@­ÓÃþ¦üªºªF¦è¡A§â¡uÀx¦s¸ê°T¡v¼g¦b¡yºK­n¸ê°T¡z¸Ì­±¡A®³¥X¨Ó²{Áà¤@¤U
Excel 2007 ¤Î Excel 20 ...
¨F©Ôªo µoªí©ó 2010-5-11 23:27


½Ð°Ýª©¥D
§Ú¦³¥h±z»¡ªº¸ô®|¤U¸ü³o­ÓÀÉ®×´ú¸Õ¥Î
§Úªº¬O2003¥i¥H¨Ï¥Î
¦ý¬O·Q½Ð°ÝÀÉ®×¥»¨­³]­p¬Oª½±µ°õ¦æ¤º®e¶Ü?
¦]¬°§Ú¤U¸ü§¹«á..¶}±ÒÀɮ׬Oª½±µ¸õ¨ì¥i¥HÀx¦s°Æ¥»ªºµe­±¿ï¶µ
¨Ï¥Î§¹«á..EXCELÀɮצWºÙ®ÇÃä·|¦³(¦³³]©w°Æ¥»)Åã¥Ü..
¥i¬O¦]¬°¤£ª¾¹D¬O¦Û°Ê°õ¦æ©Ò¥H­«½Æ¶}3¦¸ÀÉ®×....
²{¦b¤u¨ã¦C¤W­±¶]¥X"³]©w°Æ¥»"ªº¹Ï®×--(¤@¦@¦³4­Ó¹Ï®×)
½Ð°Ý­n¦p¦ó§R±¼¨º´X­Ó¹Ï®×??
§Ú¤U¸üªº¬O³o­ÓÀÉ®× copies_test_001.zip (21.42 KB)
ÁÂÁ±z!

TOP

¡u¼W¯q¶°¡v¬O­n³z¹L°õ¦æ¤u¨ã >> ¼W¯q¶°¡AµM«á«öÂsÄý¨Ó¸ü¤Jªº¡A¤£«Øijª½±µ¶}±Ò¼W¯q¶°ÀɮסC

§R°£¦Û©w¸qªº«ö¶s¥i¥H°õ¦æ¤u¨ã >> ¦Û­q
¥X²{¦Û­q¹ï¸Ü¤è¶ô«á¡A±N¤u¨ã¦C¤W¤£­nªº«ö¶s©Î¥\¯àªí¤W¤£­nªº«ü¥O©Ô¶i¦Û­q¹ï¸Ü¤è¶ô´N·|®ø¥¢ªº¡C
¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

¥»©«³Ì«á¥Ñ PD961A ©ó 2010-5-17 13:27 ½s¿è

½Ð°Ý¨F©Ôªoª©¥D:
±z³o­Óµ{¦¡ " copies_test_001.zip (21.42 KB)" ¥Î©ó¶}±Ò°ßŪÀÉ®×
¥¦¤@¼Ë¥i¥H°õ¦æ..¥u¬Oµe­±µLªkÀx¦s¦b«ü©wªº¸ê®Æ§¨¤¤
·|Åã¥Ü½Ð¥t¦s·sÀɪº¸ô®|(­n­«·s¤â°Ê¿é¤J¸ô®|)
½Ð°Ý¸Ó¦p¦ó³]©w?
ÁÂÁÂ!!

TOP

¨º­Ó¼W¯q¶°ªº¥Øªº¬O­nÅý§A¡uÀx¦sÀɮסv®É¡A¶¶«K¦b«ü©wªº¸ê®Æ§¨¤ºÀx¦s¤@­Ó¬Û¦Pªº³Æ¥÷ÀÉ
¦pªG§A­ìÀɮ׬O¥H°ßŪªº¤è¦¡¶}±Ò¡A¨º»ò¤£ºÞ¦³¨S¦³¨º­Ó¼W¯q¶°ªº¦s¦b¡A§A¥»´NµLªkÀx¦s§A¥H°ßŪ¶}±ÒªºÀÉ®×¹ï§a¡H
§A­nÀx¦s§A¥H°ßŪªº¤è¦¡¶}±ÒªºÀÉ®×´N¥u¯à¥t¦s·sÀɤ£¬O¶Ü¡H
³o¤è­±¤£¬O¨º­Ó¼W¯q¶°ªº³]©w­È¡A¬O§@·~¨t²Î¥»¨Ó´N¤£¤¹³\§AÀx¦s§A¥H°ßŪ¶}±ÒªºÀɮקa¡H¡I
¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

¦^´_ 9# ¨F©Ôªo


    ÁÂÁ¨F©Ôªoª©¥D
°Ý³o°ÝÃD...±zªº¸Ñµª¬O¤@¯ëEXCEL°ò¦·§©À..¥»¨Ó´NÀ³¸Ó­nª¾¹D

¤£¦n·N«ä!
·|³o¼Ë¸ß°Ý±zªºµ{¦¡
¬O¦]¬°¨C¤Ñ¶}SEVER¤U¸ê®Æ§¨ªº°ßŪÀÉ«á..³£¥²¶·¦A¥t¦s·sÀÉ(¤@¤Ñ­n¶}3¦¸)
©Ò¥H¦V±z½Ð¯q
¬O§_¦³§ó¦nªº¤è¦¡..¥i¥Hª½±µÀx¦sÀɨì«ü©w¸ê®Æ§¨¤¤

³y¦¨±zªº§xÂZ
¤£¦n·N«ä!!½Ð¨£½Ì!
ÁÂÁÂ!!!

TOP

¥ô¦ó¦³·N¸qªº¹ïµª³£ºâ¬O¤@ºØ¸ê°T¡A¤]³\¹ï¹q¸£°ª¤â¤w¸g¨S¦³¤°»òÀ°§U¡A¦ý¬O¹ï¤@¨Çªì¾ÇªÌ¤]³\ÁÙ¬O¦³¥Îªº¡A³oÀ³¸Ó¤£ºâ¬O¡u¥»¨Ó´NÀ³¸Ó­nª¾¹D¡vªº¡C

¦Ü©ó±zªº¡u¨C¤Ñ¶}SEVER¤U¸ê®Æ§¨ªº°ßŪÀÉ....(¤@¤Ñ­n¶}3¦¸)¡v³o­ÓºÃ°Ý
§Ú·Q¨º­Ó¼W¯q¶°¬OÀ°¤£¤W§Aªº¦£ªº¡A¤]³\§A¥i¥H¦Ò¼{¦Û¤v¼g­Ó¥¨¶°¨Ó³B²z±zªº°ÝÃD
·íµM¡A¦pªG§A­n­×¨º­Ó¼W¯q¶°¨Ó¹F¨ì§Aªº¥Øªº¡A¨º»ò§Ú¬O¤@ÂI³£¤£¤Ï¹ïªº
¸Ó¼W¯q¶°§Ú¥u¼g¹L¤@¦¸´N¨S¦A­×§ï¹L¡A­Y¦³¿³½ì·Q§ï´N§ï¡A·Q¼W¶i¥¦¯à¤O´N¥h¼W¶i¯à¤O¡A§Ú¦³´£¨Ñ±K½Xªº¡C
¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

¦U¦ì¤j¤j:
¥Î¦Û­qApplicatoin¨Æ¥ó/ºÊ±±©Ò¦³¬¡­¶Ã¯/°µ¦¨¼W¯q¶°¡A¯à°µ[Àɮ׳ƥ÷]¥~¡AÁÙ¦³­þ¨Ç¯àÀ³¥Î???

TOP

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD