°»´ú"1.xls"ÀɬO§_§e¥´¶}ª¬ºA?
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# Hsieh
ÁÂÁÂHsiehª©¥D¨ó§Ufunction Isopen()ªº«ü¾É
¦ÛÓ¨àµy·L¦³ÂI¬ð¯}
Sub ¿ï¾ÜÀɦW¶×¤J()
Dim Path1, Str1 As String
Dim wb As Workbook
Path1 = Application.ActiveWorkbook.Path
Dim Filt As String
Dim FilterIndex As Integer
Dim fileName As Variant
Dim Title As String
Filt = "Excel Files (*.xls),*.xls"
FilterIndex = 5
Title = "Select a File for Import"
fileName = Application.GetOpenFilename _
(FileFilter:=Filt, _
FilterIndex:=FilterIndex, _
Title:=Title)
If fileName = False Then
MsgBox "No file was selected."
Exit Sub
End If
Dim fso3
Set fso3 = CreateObject("Scripting.FileSystemObject")
GetAn3 = fso3.GetbaseName(fileName)
If IsOpen(GetAn3 & ".xls") <> False Then
Workbooks(GetAn3 & ".xls").Activate
Else
Set wb = Workbooks.Open(fileName, True, False)
End If
f_bookname2 = ActiveWorkbook.Name
Windows(f_bookname2).Activate
Sheets(1).Activate
end sub
Function IsOpen(Fs As String) As Boolean
IsOpen = False
For Each w In Windows
If w.Caption = Fs Then IsOpen = True: Exit For
Next
End Function
¦A½Ð±Ð¤j¤j
1. ¦p¦óÅýApplication.GetOpenFilename ©Ò¶}¤§µøµ¡¬°path1?
2.¥i¦³§ó¦nªº¼gªk?
ÁÂÁÂ |
|
|
|
|
|
|
- ©«¤l
- 2025
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 2053
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- Office2007
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_¥«
- µù¥U®É¶¡
- 2011-3-2
- ³Ì«áµn¿ý
- 2024-3-14
|
¦^´_ 9# yangjie
Function IsOpen() §Ú´ú¸Õ¬O¥i¥H°õ¦æ
¦ýÀɮצWºÙ¦³¤À¤j¤p¼g¡A¨Ò¦p Book1»PBOOK1´N·|§PÂ_¬°¤£¦P
WINDOW¨t²ÎªºÀÉ®×À³¸Ó¬O¨S¦³¤À¤j¤p¼g(ÁöµMÅã¬O¦³¤j¤p¼g) |
|
{...} ªí¥Ü»Ýn¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡
|
|
|
|
|
- ©«¤l
- 2025
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 2053
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- Office2007
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_¥«
- µù¥U®É¶¡
- 2011-3-2
- ³Ì«áµn¿ý
- 2024-3-14
|
¦^´_ 4# Hsieh
ì¨Ó¥Î.Caption´N¥i¥H¨M¸Ñ¡A¤Ó·PÁ§A¤F |
|
{...} ªí¥Ü»Ýn¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# Hsieh
¹ï¤£°_ ±N¤j¦W«÷¿ù¤F À³¬°Hsieh¤j¤j |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# Hsieh
Hseih¤j¤j ÁÂÁ±z
Function IsOpen(Fs As String) As Boolean
IsOpen = False
For Each w In Windows
If w.Caption = Fs Then IsOpen = True: Exit For
Next
End Function
¨ä¤¤ fs »P ¤Wzfilename «¬ºA¤£²Å §Ú´N¥d¦í¤F «ç»ò¿ì? |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 7# yangjie ¥Dn
¥Dn¤U¤@¦CnOpen
Set wb = Workbooks.Open(fileName, True, False)
¦ý±`¦b¤w¥´¶}¤§¤U°µ«½Æ¥´¶}
¤£¤äÀ³¦p¦ó³B²z |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¥»©«³Ì«á¥Ñ yangjie ©ó 2012-9-1 04:33 ½s¿è
¦^´_ 4# Hsieh
½Ð±Ð©óªO¥D¥ý¶i
Dim Filt As String
Dim FilterIndex As Integer
Dim fileName As Variant
Dim Title As String
Filt = "Excel Files (*.xls),*.xls"
FilterIndex = 5
Title = "Select a File for Import"
fileName = Application.GetOpenFilename _
(FileFilter:=Filt, _
FilterIndex:=FilterIndex, _
Title:=Title)
If fileName = False Then
MsgBox "No file was selected."
Exit Sub
End If
§Ú¥un±o¨ìfileName ªºÀɦW(string)À³¦p¦ó¤U»yªk?(¤£§tpath)
ÁÂÁÂ |
|
|
|
|
|
|
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
¦^´_ 4# Hsieh
¹ï¤£°_¡AJ¶Ã¦^µª¿ùªºµª®×¡A¤Q¤À©êºp:dizzy: |
|
|
|
|
|
|