- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2016-2-14 22:32 ½s¿è
¤U±Workbook쥻¦³3ÓVBA¡A¦Û±q¥[¤J¤F²Ä4ÓVBA«á¡A²Ä2ÓVBAªº®ÄªG¶}©l¦³¤FÂI°ÝÃD(EXCEL2000ª©)¡A
¬O¬Æ»ò¦a ...
RCRG µoªí©ó 2016-2-12 14:14
¨SÀÉ®×¥i¥H¸Õ, ¥¼¹ê´ú¯Â±À´ú,§A¥i¥H®M¥Î¬Ý¬Ý (PS. ´ú¸Õ«e½Ð°O±o¥ý³Æ¥÷).
¦³¥i¯à¬O:
Set xB = Workbooks.Open(xFile, ReadOnly:=True)
³o¤@¦æ¤S¥h©I¥s Workbook_Open µ{§Ç,
¦Ó¥¦¤S·|¥h°õ¦æ¨ì ²Ä2ÓVBA,
¥HP²£¥Í«D¹w´Áªºµ²ªG.
¤@¯ënÁקK¦¹Ãþ±¡§Î§Ú·|¦Ò¼{¥Î¥H¤U¨âºØ¤è¦¡¤§¤@:
1. °õ¦æµ{§Ç«e,¥ý§âIJµo¦æ¬°¶}ÃöÃö±¼,°õ¦æ§¹¦A¥´¶}:
Application.EnableEvents = False
Set xB = Workbooks.Open(xFile, ReadOnly:=True)
Application.EnableEvents = True
2. ³]¸mºX¼Ð±±¨î(ºX¼Ð¤@¯ë¶·¬°¥þ°ìÅܼÆ)¬O§_nIJµo:
Module-
Public bOpen As Boolean
Workbook_Open-
Private Sub Workbook_Open()
If bOpen Then Exit Sub
Call ÀË´ú¸ê®ÆÀÉ: If xMsg = "" Then GoTo 999 '²Ä1ÓVBA
.
.
.
bOpen = True
Set xB = Workbooks.Open(xFile, ReadOnly:=True)
bOpen = False
.
.
. |
|