หากอยากเปลี่ยนชื่อไฟล์งานอ้างอิงจาก Cell Excel ต้องปรับตรงไหนครับ
Posted: Thu Aug 17, 2023 10:29 am
สวัสดีครับ อยากสอบถามว่าหากอยากเปลี่ยนชื่อไฟล์งานอ้างอิงจาก Cell H1 ต้องแก้ไขแบบไหนครับ
"\Form.docx"
Sub extractData()
Dim wd As New Word.Application
Dim doc As Word.Document
Dim sh As Worksheet
wd.Visible = True
Set doc = wd.Documents.Open(ActiveWorkbook.Path & "\Form.docx")
Set tbls = doc.Tables
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row + 1
"\Form.docx"
Sub extractData()
Dim wd As New Word.Application
Dim doc As Word.Document
Dim sh As Worksheet
wd.Visible = True
Set doc = wd.Documents.Open(ActiveWorkbook.Path & "\Form.docx")
Set tbls = doc.Tables
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row + 1