[VBA ] 將text檔資料匯入到Excel的問題

看板Visual_Basic作者 (沙嗲王董)時間16年前 (2009/06/09 12:42), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
各位大大你們好,我在執行以下的程式碼的時候, 出現 "執行階段錯誤'9',陣列索引超出範圍"的訊息, 然後在以下程式碼中●地方,出現問題。 想請各位大大稍微幫小弟我看一下,是哪裡有出現問題,謝謝。 Range("A2").Select ActiveCell.FormulaR1C1 = "bottom1" Range("A3").Select ActiveCell.FormulaR1C1 = "bottom2" Range("A4").Select ActiveCell.FormulaR1C1 = "top1" Range("A5").Select ActiveCell.FormulaR1C1 = "top2" Range("A7").Select ActiveCell.FormulaR1C1 = "total " Range("B1").Select ActiveCell.FormulaR1C1 = "10" Range("C1").Select ActiveCell.FormulaR1C1 = "20" Range("B1:C1").Select Selection.AutoFill Destination:=Range("B1:AM1"), Type:=xlFillDefault Range("B1:AM1").Select Workbooks.OpenText Filename:="D:\building\steady\010deg.frp", Origin:= _ 950, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False, Comma:=False, _ Space:=True, Other:=True, OtherChar:=")", FieldInfo:=Array(Array(1, 1), _ Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _ Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1)), _ TrailingMinusNumbers:=True Range("S7:S12").Select Selection.Copy ● Windows("0609test.xls").Activate Range("B2").Select ActiveSheet.Paste Windows("010deg.frp").Activate ActiveWindow.Close -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.118.197.163
文章代碼(AID): #1ABUWj38 (Visual_Basic)