Set up "automatic login" on SharePoint

%3CLINGO-SUB%20id%3D%22lingo-sub-1286967%22%20slang%3D%22en-US%22%3ESet%20up%20%22automatic%20login%22%20on%20SharePoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1286967%22%20slang%3D%22en-US%22%3E%3CP%3EHello.%3CBR%20%2F%3EI%20wrote%20some%20VBA%20code%20in%20an%20Excel%20sheet%20with%20the%20intention%20of%20copying%20to%20SharePoint%20some%20managed%20files%20inside%20this%20sheet.%20Before%20I%20even%20confirm%20if%20the%20code%20works%2C%20I%20received%20an%20error%20message%20inviting%20me%20to%20add%20the%20SharePoint%20site%20to%20the%20trusted%20websites%2C%20and%20so%20I%20did.%20But%20then%20a%20second%20message%20appeared%2C%20which%20I%20am%20attaching%20here%20and%20I%20translate%20it%20from%20Italian%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22automazione.png%22%20style%3D%22width%3A%20367px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182620iEE7AAE495D05E3C7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22automazione.png%22%20alt%3D%22automazione.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%22%3CEM%3ERun-time%20error%20'-2147024672%20(800700e0)'%3A%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%3CBR%20%2F%3EAutomation%20error%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EAccess%20denied.%20Before%20opening%20files%20in%20this%20path%2C%20you%20must%20add%20the%20website%20to%20the%20list%20of%20trusted%20sites%2C%20go%20to%20the%20website%20and%20select%20the%20automatic%20login%20option.%3C%2FEM%3E%22%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20I%20don't%20understand%20when%20says%20to%20go%20to%20the%20website%20(therefore%20to%20the%20SharePoint%20site)%20and%20set%20the%20%22automatic%20login%22...%20what%20does%20this%20mean%3F%20I%20tried%20to%20automate%20the%20credentials%20login%20but%20obviously%20this%20is%20not%20what%20it%20was%20referring%20to.%3CBR%20%2F%3E%3CU%3EIs%20there%20any%20configuration%20to%20set%20up%20automatic%20login%20that%20eludes%20me%3F%3C%2FU%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EIf%20it%20can%20be%20useful%2C%20I%20also%20enter%20the%20VBA%20code%20used%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3ESub%20AddSharePointFolder()%0A%20%20%20Dim%20FSO%20As%20Object%0A%20%20%20Dim%20FromPath%20As%20String%0A%20%20%20Dim%20ToPath%20As%20String%0A%0A%20%20%20ToPath%20%3D%20%22%5C%5CMYSITE.sharepoint.com%40SSL%5CDavWWWRoot%5Csites%5CSITESNAME%5C%22%0A%20%20%20FromPath%20%3D%20%22C%3A%5CUsers%5CMYNAME%5CDesktop%5CTest%22%0A%0A%20%20%20Set%20FSO%20%3D%20CreateObject(%22scripting.filesystemobject%22)%0A%20%20%20FSO.CopyFolder%20Source%3A%3DFromPath%2C%20Destination%3A%3DToPath%0A%0A%20%20%20MsgBox(%22Done!%22)%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3ESub%20AddSharePointFolder()%0A%20%20%20Dim%20FSO%20As%20Object%0A%20%20%20Dim%20FromPath%20As%20String%0A%20%20%20Dim%20ToPath%20As%20String%0A%0A%20%20%20ToPath%20%3D%20%22%5C%5CMYSITE.sharepoint.com%40SSL%5CDavWWWRoot%5Csites%5CSITESNAME%5C%22%0A%20%20%20FromPath%20%3D%20%22C%3A%5CUsers%5CMYNAME%5CDesktop%5CTest%22%0A%0A%20%20%20Set%20FSO%20%3D%20CreateObject(%22scripting.filesystemobject%22)%0A%20%20%20FSO.CopyFolder%20Source%3A%3DFromPath%2C%20Destination%3A%3DToPath%0A%0A%20%20%20MsgBox(%22Done!%22)%0AEnd%20Sub%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1286967%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVba%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

Hello.
I wrote some VBA code in an Excel sheet with the intention of copying to SharePoint some managed files inside this sheet. Before I even confirm if the code works, I received an error message inviting me to add the SharePoint site to the trusted websites, and so I did. But then a second message appeared, which I am attaching here and I translate it from Italian:

automazione.png
"Run-time error '-2147024672 (800700e0)':

Automation error

Access denied. Before opening files in this path, you must add the website to the list of trusted sites, go to the website and select the automatic login option."

But I don't understand when says to go to the website (therefore to the SharePoint site) and set the "automatic login"... what does this mean? I tried to automate the credentials login but obviously this is not what it was referring to.
Is there any configuration to set up automatic login that eludes me?

If it can be useful, I also enter the VBA code used:

Spoiler
Sub AddSharePointFolder()
   Dim FSO As Object
   Dim FromPath As String
   Dim ToPath As String

   ToPath = "\\MYSITE.sharepoint.com@SSL\DavWWWRoot\sites\SITESNAME\"
   FromPath = "C:\Users\MYNAME\Desktop\Test"

   Set FSO = CreateObject("scripting.filesystemobject")
   FSO.CopyFolder Source:=FromPath, Destination:=ToPath

   MsgBox("Done!")
End Sub

 

0 Replies