Map Citrix Network drive using UNC path VBA

ssingh75

Well-known Member
Joined
Jan 5, 2012
Messages
518
There is MS access database placed on Citrix environment and i'm trying to Map the network drive but getting error message.

Path = \\abcd365.sharepoint.com@SSL\DavWWWRoot\sites\CommunicationDev\test_tree\test\test1
I'm using the below code to map it....but getting error message.

Set objNet = CreateObject("WScript.Network")
If FolderExists(sharepointFileName) Then
objNet.RemoveNetworkDrive (strShareLetter)
Else
objNet.MapNetworkDrive strShareLetter, sharepointFileName, False, strUser, strPassword
End If
 
My code change suggestion was to add quotes to the sharepointFileName value:

old code:
Code:
sharepointFileName=\\abcd.sharepoint.com@SSL\DavWWWRoot\sites\CommunicationDev\test_tree\abd_UAT\Data
new code:
sharepointFileName="\\abcd.sharepoint.com@SSL\DavWWWRoot\sites\CommunicationDev\test_tree\abd_UAT\Data"

To debug you should step through the code and execute one line at a time to check each instruction. See here:
http://krgreenlee.blogspot.com/2006/04/programming-excel-vba-debugging-for.html
also here:
https://www.excel-easy.com/vba/examples/debugging.html

While stepping through code you can also use your mouse to "hover over" variables and check their values. You want to confirm that variables all have the expected and correct values when the code is executing.
 
Last edited:
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
My code change suggestion was to add quotes to the sharepointFileName value:

old code:
Code:
sharepointFileName=\\abcd.sharepoint.com@SSL\DavWWWRoot\sites\CommunicationDev\test_tree\abd_UAT\Data
new code:


To debug you should step through the code and execute one line at a time to check each instruction. See here:
http://krgreenlee.blogspot.com/2006/04/programming-excel-vba-debugging-for.html
also here:
https://www.excel-easy.com/vba/examples/debugging.html

While stepping through code you can also use your mouse to "hover over" variables and check their values. You want to confirm that variables all have the expected and correct values when the code is executing.


Yes, I did the same and debug the code. But same error message is occuring. Could you please provide me the some sort line of code which i can use to map network drive on citrix using user id and pass

Thanks
 
Upvote 0
Hi please advise the line of code where the error occurs when you step through the code.
 
Upvote 0
Hi please advise the line of code where the error occurs when you step through the code.


Below is the link of code where i m getting error message.

objNet.MapNetworkDrive strShareLetter, sharepointFileName, False, strUser, strPassword
 
Upvote 0
There is nothing wrong with id and password...When i tried to map network drive manually using the id and password it worked well.
But i've received the error message as mentioned in the previous comment when tried using VBA.

Its citrix environment where i would like to map the network drive of sharepoint path in UNC format.


so you're using a different path format when you do it manually than when you do it with VBA ?


 
Upvote 0
[/COLOR]

so you're using a different path format when you do it manually than when you do it with VBA ?



No. Its the same path. When i'm trying to connect manually m able to connect it. But via code m getting the error message..

Is there any way that we can map permanently network drive on citrix enviornment
 
Upvote 0
objNet.MapNetworkDrive strShareLetter, sharepointFileName, False, strUser, strPassword
since this is the line with the problem, next step is to test the values of the variables when the error occurs.
What are the values of strShareLetter, sharepointFileName, , strUser, and strPassword at the time the error occurs?

Please recall what I said in my first post:
Note that generally I've found citrix questions to be difficult to answer - most people don't have a citrix environment to test in and it appears that it can be quite different where VBA is involved.


Since it appears all you are doing is copying a file, you might also consider if you can copy the file directly without creating the mapped drive.
 
Upvote 0
abcd365 is not a site I can access (at least not from work) - I can't find a abcd365 in google searches either. Is this a private intranet site? I'm afraid I don't have any code for you related to this particular requirement.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top