請問紅色的部份該怎麼修改?
主要是打開某個WORD檔,然後在第一個表格的第一格內容會直接複製EXCEL檔的[B2]儲存格
Sub transform()
Dim xlApp As Object
Set xlApp = CreateObject("word.application")
With xlApp
xlApp.Visible = True
xlApp.Documents.Open "C:\Users\Desktop\Doc1.docx"
xlApp.ThisDocument.Table(1).cell(1, 1) = ActiveSheet.Range("B2").Value
End With
End Sub作者: kimbal 時間: 2011-2-5 00:06
Sub transform()
Dim xlApp As Object
Set xlApp = CreateObject("word.application")
With xlApp
xlApp.Visible = True
xlApp.Documents.Open "C:\temp\Doc1.docx"
xlApp.activedocument.Tables(1).cell(1, 1).Select
xlApp.Selection.TypeText ActiveSheet.Range("B2").Value
End With
End Sub作者: color790 時間: 2011-2-5 00:13
感恩感恩~下禮拜來公司用用看~作者: color790 時間: 2011-2-9 16:13
Sub transform()
Dim xlApp As Object
Set xlApp = CreateObject("word.application")
With xlApp ...
kimbal 發表於 2011-2-5 00:06