Hi All,
I am really struggling to find a simple solution to what seems a simple thing to do. Namely, open a Txt file in SharePoint enter some data and close it. I have tried what seems like every method and still nothing. Can anyone offer me any advice?
EDIT: I can copy the Txt file to my desktop and add data there, but cannot save back to SharePoint. If I could do that I could kill the desktop file. Messy, but it would work.
Sub TextFile()
Dim TextFile As Integer
Dim FilePath As String
FilePath = "\\MyName.sharepoint.com\Documents\text.txt"
TextFile = FreeFile
Open FilePath For Output As TextFile
Print #TextFile, "Hello Everyone!"
Close TextFile
End Sub
I am really struggling to find a simple solution to what seems a simple thing to do. Namely, open a Txt file in SharePoint enter some data and close it. I have tried what seems like every method and still nothing. Can anyone offer me any advice?
EDIT: I can copy the Txt file to my desktop and add data there, but cannot save back to SharePoint. If I could do that I could kill the desktop file. Messy, but it would work.
Sub TextFile()
Dim TextFile As Integer
Dim FilePath As String
FilePath = "\\MyName.sharepoint.com\Documents\text.txt"
TextFile = FreeFile
Open FilePath For Output As TextFile
Print #TextFile, "Hello Everyone!"
Close TextFile
End Sub
Last edited: