Good evening,
Please can someone help with this.
I have a macro workbook that accesses a SharePoint folder to import some modules. This works perfectly well if the user has mapped the SharePoint drive to their computer (I guess because Windows establishes a connection to this drive when logging in).
However, if the user has not mapped the drive, it cause a Runtime Error 52. If I manually open the folder in Windows Exporer (without mapping, just typing the address in Windows explorer) and then re run the macro, it works perfectly.
Code:
Is there a way, through VBA, that I could establish this connection but not open the folder?
Thanks for any help that you can offer
Please can someone help with this.
I have a macro workbook that accesses a SharePoint folder to import some modules. This works perfectly well if the user has mapped the SharePoint drive to their computer (I guess because Windows establishes a connection to this drive when logging in).
However, if the user has not mapped the drive, it cause a Runtime Error 52. If I manually open the folder in Windows Exporer (without mapping, just typing the address in Windows explorer) and then re run the macro, it works perfectly.
Code:
Code:
Sub GetCodeLibModules
Dim strFileName As String
MODEL_OUTPUT_MODULE_FOLDER = "\\Sharepoint....."
strFileName = Dir(MODEL_OUTPUT_FOLDER)
Do While Len(strFileNAme) > 0
ThisWorkbook.VBProject.VBComponents.Import (MODEL_OUTPUT_MODULE_FOLDER & strFileName)
strFileName = Dir
Loop
End Sub
Is there a way, through VBA, that I could establish this connection but not open the folder?
Thanks for any help that you can offer