เนื่องจาก ต้องการ upload file เอกสารที่เราเลือกจาก ไดร์ส่วนตัวเรา เพื่อให้เป็นอยู่ที่ drive SharePoint ที่เราต้องการเก็บเอกสาร
โดย เบื้องต้นได้กำหนด ปุ่ม ให้ค้นหา และแสดงที่อยู่เบื่องต้นที่เราค้นหา ใน Textbox87 ลำดับต่อไปต้องการ คือ
1.ให้ upload file ไปที่ SharePoint ที่เราต้องการเก็บเอกสาร ไม่ทราบว่าต้องใช้ Code อย่างไรค่ะ
2. เมื่อ upload file ได้แล้ว กรณีที่เราต้องการค้นหา file ที่ upload ลงไปเพื่อเปิดดู ทำได้ไหมค่ะ ต้องใช้ code อะไรบ้างค่ะ เบื้องต้นกำหนดให้ลงค่าใน file
error ตรง objNet.MapNetworkDrive "A: ", SharepointAddress
Code: Select all
Private Sub CommandButton12_Click()
Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object
SharepointAddress = "https://sharepoint.com/teams/DCC"
LocalAddress = "Textbox.87.text"
Set objNet = CreateObject("WScript.Network")
Set FS = CreateObject("Scripting.FileSystemObject")
objNet.MapNetworkDrive "A: " , SharepointAddress
If FS.FileExists(LocalAddress) Then
FS.CopyFile LocalAddress, SharepointAddress
End If
objNet.RemoveNetworkDrive "A: "
Set objNet = Nothing
Set FS = Nothing
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("2022 DAR ")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets("2022 DAR LOCK").Cells(nr, 1) = UserForm1.TextBox9.Value
ssheet.Cells(nr, 77) = "A:)"
End Sub
You do not have the required permissions to view the files attached to this post.