Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using "OpenFileDialog" to open an excel file from shared drive in vb.net.

Now this code is working perfectly on my computer.
but when i am creating setup of this project and installing on client machine,
i am unable to access shared drive

Clients pc is showing shared drive in "my computer" but it is not showing shared drive
in installed setup.

Client has windows 10. I have also try regedit tips shown on some website but it is not working.

What I have tried:

VB
Dim OpenExcel As New OpenFileDialog
OpenExcel.Multiselect = False
OpenExcel.Title = "File Search"
OpenExcel.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm"


OpenExcel.InitialDirectory = Path  
'Here path is a folder path of the shared drive

Dim Result As DialogResult
Result = OpenExcel.ShowDialog()

If Result = Windows.Forms.DialogResult.OK Then
			
	'task to perform
			
End If
Posted
Updated 12-Aug-21 0:16am

1 solution

We can't help you - it needs access to your code running on your client's system, and we have access to neither.

So start by logging: add lines to print to a log file what if going on:
VB
' LOG HERE to show it's in the method
Dim OpenExcel As New OpenFileDialog
OpenExcel.Multiselect = False
OpenExcel.Title = "File Search"
OpenExcel.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm"


OpenExcel.InitialDirectory = Path  
' LOG HERE to show Path
'Here path is a folder path of the shared drive

Dim Result As DialogResult
Result = OpenExcel.ShowDialog()
' LOG HERE to show result

If Result = Windows.Forms.DialogResult.OK Then
    ' LOG HERE to show full path to file.
			
	'task to perform
			
End If
Then when the problem has occured you get the client to send the file you you along with screenshots of the Open Dialog so you can look at them and maybe see what is happening.

But at the moment, you are just whistling in the dark - you need information to fix this!
 
Share this answer
 
Comments
Devendra Sarang 12-Aug-21 6:32am    
I am creating setup file of my project and installing that setup file on client machine.

that shared drive is showing in My computer on client machine but
it is not showing on program which is installing
OriginalGriff 12-Aug-21 7:51am    
So you need to find out *exactly* what is happening.
Not what seems to be happening, what actually is.

My code can access my shared drives without any problems: I have half a dozen on my NASes and they all work fine.
So you need to look at the local situation and log what your code is doing (because you can't install a debugger on the client equipment) rather than assuming that it's doing what the client is telling you happens ...

Log files and screenshots: you need them both!
Devendra Sarang 12-Aug-21 10:04am    
It is possible that shared drive permission may be crating some issue
I have just tested one thing.
I have open the "Notepad" and try to open shared drive from its "Open" menu. It is showing shared drive.

But
when now i am opening "Notepad" using "Run as administrator" option and try to open shared drive but it is not showing in this case.

so is it possible that permission on shared drive causing some issue ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900