ªð¦^¦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°Ý

¦^´_ 1# Hsieh
«ö·Óª©¥D«ä¸ô,§Ú°µ¤F­Ó¤å¥ó,¸Ó¤å¥ó¤£¤¹³\´¡¤J"sheet".¦Ó¤£¼vÅT¨ä¥L¤å¥ó¥¿±`¥i¥H´¡¤J·s­¶ ­­¨î´¡¤J·s­¶ªº¤å¥ó.rar (15.41 KB)
lmh

TOP

¦^´_ 1# Hsieh


    ³o½g¤å³¹¤w¸g¦h¦~¤F¡A¦ý¬O¥i§_½Ð°ÝH¤j¡A
Ãö©óª«¥óÃþ§O¼Ò²Õ  ³o­ÓªF¦èªº©w¸q»P¨Ï¥Î
¦³¨S¦³¤ñ¸û¥i¥H¾Ç²ßªº¦a¤è¡A¤p§Ì¨S¦³¾Ç¹LVB
¤@¶}©l±µÄ²µ{¦¡´N¬O¸IVBA¡A¦b¬Ý®Ñªº¹Lµ{·í¤¤¹ï©óª«¥óÃþ§O¼Ò²ÕªºÀ³¥Î»P¬[³]¯uªº¤£¤Ó¤F¸Ñ

¥t¥~¤]¬Ý¨ì±z¤§«eªº¤å³¹
¥Îª«¥óÃþ§O¼Ò²Õ¬[³]²³æªº­pºâ¾÷³o­Ó½d¨Ò
http://forum.twbts.com/viewthrea ... %AB%A5%F3%C3%FE%A7O
»¡¯uªºÀ³¸Ó±q¦ó¤U¤â¾\Ūµ{¦¡½X©O@@?

TOP

ÁÂÁÂ!

§Ú¬O·Qª¾¹D¡A¦U¦ì¤j¤j¹L¥h´¿¸gÀ³¥Îªº¨Ò¤l¡C

TOP

¦^´_ 10# ohsw


    ¥»¤åªº­«ÂI¬O¾Ç²ß§Q¥Î¤u§@諸¨Æ¥ó¡A¨Ó°µÃþ§OªºÀ³¥Î
±q¾ã­Ó°ò¥»¬[ºc¡AÅý±z¤F¸Ñ¦p¦ó«Ø¥ßª«¥óÃþ§O¡AµM«á§Q¥Î³o­Óª«¥óÃþ§Oªº¦@¦P¯S©Ê°õ¦æÃþ¦ü°Ê§@
©Ò¥H¡A°£¤FºÊ±±¬¡­¶Ã¯¨Æ¥ó¨ÓÀx¦s¤å¥ó°Æ¥»¥~¡A§A¥i§Q¥Î³o¨ÇÆ[©À¨Ó¬[ºc§A©Ò»Ýªº¥ô¦óª«¥ó©Ò¾Ö¦³ªº¦@¦P¦æ¬°
´N¬Ý§A¦p¦ó¥h¹B¥Î¤F
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

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

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

¦^´_ 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

¨º­Ó¼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

¥»©«³Ì«á¥Ñ 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

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD