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

EXCEL§ì¨úCSV¸ê®Æ¨Ã§Y®É§ó·s

¦^´_ 1# jasonwu0114
ªþ¤W¤£¦æªºµ{¦¡½X¬Ý¬Ý

TOP

¤£¶}±ÒÀɮפUŪ¨ú¸ê®Æªº¸ô®|/ÀɦW³]©w¬°ÅܼưÝÃD

±ýŪ¨úªºEXCELÀɦW¤¤³£¦³·í¤Ñ¤é´Á(ex:ooxxx1021216.xls)
·Q°µ¤@±i·JÁ`ªí¦s©ñ¦b¥t¤@­Ó¸ê®Æ§¨
·JÁ`ªíAÄæ¦ì¬O§Ú­nªº¤é´Á

¥H¤£¶}±ÒÀɮפ覡¨ÓŪ¨ú¸ê®Æ
¦³¸Õ¹Lª½±µ¥Î     "µu´ÁªÑÅv§ë¸ê³¡¦ì¤Îµû»ù±±ºÞªí1021216.xls"  ¬O§ì¨ì¸ê®Æ
¦ý§ï¦¨" µu´ÁªÑÅv§ë¸ê³¡¦ì¤Îµû»ù±±ºÞªí" &  dd  & ".xls"
¥ÎÅܼƤ覡´N¤£¦æ
¥X²{­n§Ú¿ï¨úÀɮתºµe­±
  
À³¸Ó¬OÅܼƳ]©w¿ù»~
½Ð°Ý
1.Åܼƭn¦p¦ó³]©w??
2.ÁÙ¦³¨ä¥L§ó¤è«Kªº¤è¦¡¨ÓŪ¨ú¥¼¶}±ÒÀɮ׸ê®Æ??


Sub checkclosedfile1()
Dim strpath As String, strfile As String
Dim strsheet As String, strresult As String
    strpath = "X:\­·ºÞ³øªí\µu´ÁªÑÅv§ë¸ê³¡¦ì¤Îµû»ù±±ºÞªí"
    strfile = "µu´ÁªÑÅv§ë¸ê³¡¦ì¤Îµû»ù±±ºÞªí1021202.xls"
    strsheet = "¥þ¤½¥qI"
    strresult = getcellvalue(strpath, strfile, strsheet, "i1")
Cells(2, 2) = strresult
End Sub

Public Function getcellvalue(strpath As String, strfile As String, strsheet As String, stra1 As String)
    getcellvalue = ExecuteExcel4Macro("'" & "[" & strfile & "]" & strsheet & "'!" & Range(stra1).Address(, , xlR1C1))
End Function
¤p¤Hª«

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD