Forum Discussion
kheldar
May 27, 2022Iron Contributor
VBA and SharePoint URL Longer Than 255 Characters
Hello, Is there a workaround to bypass this error? Sub CallFile(ByVal File As String)
Workbooks("Master Workbook.xlsm").Activate
Debug.Print File
Workbooks.Open File
End Sub ...
- Jun 01, 2022
kheldar
I managed to do it with network drive mappingmy code:
Public Function SPDrive(Drive As String, Url As String) On Error Resume Next Dim objNet As Object Dim FS As Object Dim objFolder As Object Set objNet = Nothing Set FS = Nothing Set objFolder = Nothing Set objNet = CreateObject("WScript.Network") Set FS = CreateObject("Scripting.FileSystemObject") Set objFolder = FS.getfolder(Drive) objNet.RemoveNetworkDrive Drive objNet.MapNetworkDrive Drive, Url Debug.Print Url End Function
kheldar
May 27, 2022Iron Contributor
I forgot to mention that the reason I'm trying this method is that Online functionalities of the document needs be enabled since all the files will be edited collaboratively.
kheldar
Jun 01, 2022Iron Contributor
kheldar
I managed to do it with network drive mapping
my code:
Public Function SPDrive(Drive As String, Url As String)
On Error Resume Next
Dim objNet As Object
Dim FS As Object
Dim objFolder As Object
Set objNet = Nothing
Set FS = Nothing
Set objFolder = Nothing
Set objNet = CreateObject("WScript.Network")
Set FS = CreateObject("Scripting.FileSystemObject")
Set objFolder = FS.getfolder(Drive)
objNet.RemoveNetworkDrive Drive
objNet.MapNetworkDrive Drive, Url
Debug.Print Url
End Function