äžç¥é以äžæè¿°æ¯åŠæåž®å©
----------------------------------------------------------------------------
å
šéšæŸç€º
OpenText æ¹æ³
请åé
åºçšäº ç€ºäŸ ç¹æ§
蜜å
¥äžäžªææ¬æ件ïŒå¹¶å°å
¶äœäžºå
å«å䞪工äœè¡šçå·¥äœç°¿è¿è¡ååå€çïŒç¶ååšæ€å·¥äœè¡šäžæŸå
¥ç»è¿ååå€ççææ¬æ件æ°æ®ã
expression.OpenText(FileName, Origin, StartRow, DataType, TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar, FieldInfo, TextVisualLayout, DecimalSeparator, ThousandsSeparator, TrailingMinusNumbers, Local)
expression å¿
éã该衚蟟åŒè¿åâåºçšäºâåè¡šäžçäžäžªå¯¹è±¡ã
FileName String ç±»åïŒå¿
éãæå®èŠèœœå
¥å¹¶äœååå€ççæ件åã
Origin Variant ç±»åïŒå¯éãæå®ææ¬æ件æ¥æºãå¯äžºä»¥äž XlPlatform åžžéä¹äžïŒxlMacintoshãxlWindows æ xlMSDOSãåŠæçç¥è¯¥åæ°ïŒåæ€æ¹æ³å°±äŒäœ¿çšåšâææ¬å¯Œå
¥å富âäžçâæ件æ¥æºâé项çåœå讟眮ã
StartRow Variant ç±»åïŒå¯éãäœååå€ççèµ·å§è¡å·ãé»è®€åŒäžº 1ã
DataType Variant ç±»åïŒå¯éãåšæ件äžæå®æ°æ®çåæ ŒåŒãå¯äžºä»¥äž XlTextParsingType åžžéä¹äžïŒxlDelimited æ xlFixedWidthãåŠææªæå®è¯¥åæ°ïŒå Microsoft Excel å°åšæåŒæ€æ件æ¶ç¡®å®åæ ŒåŒã
TextQualifier XlTextQualifier ç±»åïŒå¯éãæå®ææ¬è¯å«ç¬Šã
XlTextQualifier å¯äžºä»¥äž XlTextQualifier åžžéä¹äžã
xlTextQualifierDoubleQuote default
xlTextQualifierNone
xlTextQualifierSingleQuote
ConsecutiveDelimiter Variant ç±»åïŒå¯éãåŠæ该åŒäžº TrueïŒåå°è¿ç»çåé笊å·äœäžºäžäžªåé笊å·å€çãé»è®€åŒäžº Falseã
Tab Variant ç±»åïŒå¯éãåŠæ该åŒäžº TrueïŒåå°åé笊讟䞺å¶è¡šç¬ŠïŒDataType å¿
须讟䞺 xlDelimitedïŒãé»è®€åŒäžº Falseã
Semicolon Variant ç±»åïŒå¯éãåŠæ该åŒäžºTrueïŒåå°åé笊讟䞺åå·ïŒDataType å¿
须讟䞺 xlDelimitedïŒãé»è®€åŒäžº Falseã
Comma Variant ç±»åïŒå¯éãåŠæ该åŒäžº TrueïŒåå°åé笊讟䞺éå·ïŒDataType å¿
须讟䞺 xlDelimitedïŒãé»è®€åŒäžº Falseã
Space Variant ç±»åïŒå¯éãåŠæ该åŒäžº TrueïŒååéç¬Šè®Ÿäžºç©ºæ ŒïŒDataType å¿
须讟䞺 xlDelimitedïŒãé»è®€åŒäžº Falseã
Other Variant ç±»åïŒå¯éãåŠæ该åŒäžºTrueïŒåå°åéç¬Šè®Ÿäžºç± OtherChar åæ°æå®çå笊ïŒDataType å¿
须讟䞺 xlDelimitedïŒãé»è®€åŒäžº Falseã
OtherChar Variant ç±»åïŒå¯éïŒåŠæ Other 䞺 TrueïŒåå¿
éïŒãåœ Other 䞺 True æ¶ïŒæå®åéå笊ãåŠææå®äºå€äžªå笊ïŒåå°å笊䞲äžç第äžäžªå笊äœäžºåé笊ïŒå¹¶å¿œç¥å
¶äœçå笊ã
FieldInfo xlColumnDataType ç±»åïŒå¯éãå
å«åæ°æ®ååæä¿¡æ¯çæ°ç»ã对æ¬åæ°ç解éåå³äº DataType åŒãåŠææ€æ°æ®ç±åé笊åéïŒæ¬åæ°äžºç±äž€å
çŽ æ°ç»ç»æçæ°ç»ïŒå
¶äžæ¯äžªäž€å
çŽ æ°ç»æå®äžäžªç¹å®åç蜬æ¢é项ã第äžäžªå
çŽ äžºåæ ïŒä» 1 åŒå§ïŒïŒç¬¬äºäžªå
çŽ æ¯ XlColumnDataType åžžéä¹äžïŒçšä»¥æå®åŠäœåæ该åã
XlColumnDataType å¯äžºä»¥äž XlColumnDataType åžžéä¹äžã
xlGeneralFormat åžžè§
xlTextFormat ææ¬
xlMDYFormat MDY æ¥æ
xlDMYFormat DMY æ¥æ
xlYMDFormat YMD æ¥æ
xlMYDFormat MYD æ¥æ
xlDYMFormat DYM æ¥æ
xlYDMFormat YDM æ¥æ
xlEMDFormat EMD æ¥æ
xlSkipColumn å¿œç¥å
åªæåšå®è£
并éå®äºå°æ¹Ÿå°åºè¯èšæ¯ææ¶æå¯äœ¿çš xlEMDFormatãxlEMDFormat åžžéæå®äœ¿çšå°æ¹Ÿå°åºçºªå¹Žæ¥æã
åæ è¯ç¬Šæå®é¡ºåºäžéãèŸå
¥æ°æ®äžåŠææå没æåæ è¯ç¬ŠïŒåçšåžžè§è®Ÿçœ®å¯¹è¯¥åè¿è¡ååå€çãæ¬ç€ºäŸè®Ÿçœ®ååå€çæ¶è·³è¿ç¬¬äžåïŒå°ç¬¬äžåäœäžºææ¬å€çïŒæºæ°æ®äžå
¶ä»å以垞è§è®Ÿçœ®è¿è¡ååå€çã
Array(Array(3, 9), Array(1, 2))åŠææºæ°æ®äžºå®å®œåïŒåæ¯äžªäž€å
æ°ç»ç第äžäžªå
çŽ æå®èµ·å§å
çŽ åšåäžçäœçœ®ïŒïŒçšæŽæ°è¡šç€ºïŒç¬¬äžäžªå笊䞺 0 (é¶)ïŒïŒç¬¬äºäžªå
çŽ çš 1 å° 9 çæ°åæå®ååé项ïŒåŠåè¡šæ瀺ã
äžå瀺äŸåšäžäžªå®å®œææ¬æ件äžåååºäž€åã第äžåå
å«ä»ç¬¬ 1 è³ç¬¬ 10 䞪å笊ïŒå¿œç¥ç¬¬ 11ã12ã13ã14 å 15 䞪å笊ã第äºåå
å«ä»ç¬¬ 16 䞪å笊è³è¯¥è¡çæåäžäžªå笊ã
Array(Array(0, 1), Array(10, 9), Array(15, 1))TextVisualLayout Variant ç±»åïŒå¯éãæåçå¯è§åžå±ã
DecimalSeparator Variant ç±»åïŒå¯éã衚瀺åšè¯å«æ°åæ¶ïŒMicrosoft Excel 䜿çšçå°æ°äœåé笊ãé»è®€è®Ÿçœ®äžºç³»ç»è®Ÿçœ®ã
ThousandsSeparator Variant ç±»åïŒå¯éã衚瀺åšè¯å«æ°åæ¶ïŒExcel 䜿çšçåäœåé笊ãé»è®€è®Ÿçœ®äžºç³»ç»è®Ÿçœ®ã
äžè¡šæŸç€ºäºäœ¿çšäžåç富å
¥è®Ÿçœ®å Excel äžå¯Œå
¥ææ¬æ¶çç»æãæ°åç»ææŸç€ºåšæå³èŸ¹çåäžã
ç³»ç»å°æ°äœåé笊 ç³»ç»åäœåé笊 å°æ°äœåéç¬ŠåŒ åäœåéç¬ŠåŒ å¯Œå
¥çææ¬ åå
æ ŒçåŒïŒæ°æ®ç±»åïŒ
å¥ç¹ éå· éå· å¥ç¹ 123,123.45 123,123.45ïŒæ°åïŒ
å¥ç¹ éå· éå· éå· 123,123.45 123,123.45ïŒææ¬ïŒ
éå· å¥ç¹ éå· å¥ç¹ 123,123.45 123,123.45ïŒæ°åïŒ
å¥ç¹ éå· å¥ç¹ éå· 123,123.45 123 123.45ïŒææ¬ïŒ
å¥ç¹ éå· å¥ç¹ ç©ºæ Œ 123,123.45 123,123.45ïŒæ°åïŒ
TrailingMinusNumbers Variant ç±»åïŒå¯éã
Local Variant ç±»åïŒå¯éã
瀺äŸ
æ¬ç€ºäŸæåŒ Data.txt æ件并å°å¶è¡šç¬Šäœäžºåé笊对æ€æ件è¿è¡ååå€çïŒèœ¬æ¢æ䞺工äœè¡šã
Workbooks.OpenText filename:="DATA.TXT", _
dataType:=xlDelimited, tab:=True
----------------------------------------------------------------------------
âââââââââââââ
æ£çä»âæâåŒå§
http://wps.kingsoft.com/
âââââââââââââ
æ±æïŒäžå¥œææïŒäžå€ªæ䜿çšçŒäœç³»çµ±ã
æ³è«æåäœå€§å€§ïŒ
æ人ç¥éåŠäœè®å³é²EXCELçæåæªäžèŠåæ¬ïŒå°±çŽæ¥çœ®æŸæŒç¬¬äžæ¬å¢ïŒ
æåçAPæ¯çµç«¯æ©æš¡æ¬çšåŒNETTERMïŒå¯ä»¥åŒå«EXCEL.EXEïŒEXCELæ¯2003ïŒç®åççµææ¯å®æèªåäŸåºå®ééå»åæ幟æ¬ïŒææ²æ蟊æ³è®å®äžèŠåå¢ïŒ
ææŸéEXCELçèšå®ïŒéœæŸäžå°......
æè¬ïŒæè¬ïŒ
mary