µ{¦¡±Ò°Ê®É¡A¾Ü¤@¶}±Ò¥t¥~¨âÓÀÉ®×
- ©«¤l
- 79
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 123
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- x64
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-10-24
- ³Ì«áµn¿ý
- 2024-3-28
|
µ{¦¡±Ò°Ê®É¡A¾Ü¤@¶}±Ò¥t¥~¨âÓÀÉ®×
µ{¦¡±Ò°Ê®É¡A¾Ü¤@¶}±Ò¥t¥~¨âÓÀÉ®×
½Ð°Ý¦p«O¶}±Òexcel «á¡A¦bPrivate Sub Workbook_Open() ¾Ü¤@¶}±ÒÀÉ®×
Private Sub Workbook_Open()
Workbooks.Open Filename:=ThisWorkbook.Worksheets("Sheet1").Range("B14").value
Workbooks.Open Filename:=ThisWorkbook.Worksheets("Sheet1").Range("B18").value
End Sub
¦pªG b14 ¦ì¸mªºÀÉ®×¥i¥H¶}±Ò¦¨¥\¡A´N¤£¶}±ÒB18ªºÀÉ®×
¦pªG b14 µLªk¶}±Ò¡A«h§ï¶}±Ò b18 ¡]¦pªG b18 ¤]µLªk¶}±Ò¡A«hÅã¥Ü msg "open file error" ¡^
½Ð°Ý¸Ó«ç»ò¼g¡H¡H «ç»ò¼g«ç»ò©Ç~~
Set MyBook = Workbooks.Open Filename:=ThisWorkbook.Worksheets("°ò¥»¸ê®Æ").Range("B18").value
On Error GoTo 0
If MyBook Is Nothing Then
Workbooks.Open Filename:=ThisWorkbook.Worksheets("°ò¥»¸ê®Æ").Range("B18").value
End If
Else |
|
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^
|
|
|
|
|
- ©«¤l
- 79
- ¥DÃD
- 33
- ºëµØ
- 0
- ¿n¤À
- 123
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- x64
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2013-10-24
- ³Ì«áµn¿ý
- 2024-3-28
|
¦^´_ 2# prin.huang
«D±`·PÁ¡A§Úèè«·sקï§Úªº¨t²Î¡A²×²×¥i¥H¥¿±`¹B§@¤F¡A¤Q¤À·PÁ§Aªº¨ó§U~~~ |
|
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^
|
|
|
|
|
- ©«¤l
- 44
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 84
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- sp2
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2016-10-12
- ³Ì«áµn¿ý
- 2021-11-10
|
- Private Sub Workbook_Open()
- dim fs as object, Sdir$
- set fs=createobject("Scripting.FileSystemObject")
- with thisworkbook.worksheets("°ò¥»¸ê®Æ")
- if fs.FileExists(.Range("B14").value) then
- SDir = .range("B14").value
- else if fs.FileExists(.Range("B18").value) then
- SDir = .range("B14").value
- else
- msgbox "Open file error"
- end if
- Set MyBook = Workbooks.Open Filename:=
- end sub
½Æ»s¥N½X |
|
|
|
|
|
|