Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Map Network Drive FAO Gary's Student
Hi,
many thanks for the peice of code as below: net use d:/delete/y net use d:"\bft-123456w\d$"/PERSISTENT:yes pause wherby d:/ is the Drive letter for the Belfast PC? without coming over as thick... you said create a file called leerem.bat containing the code above and then execute the .bat file Question 1: Do you mean create an excel file and write the code in the open workbook section and then save the file as leerem with a .bat extension? Question 2: To execute this .bat file would I write the code as follows; Sub bft() dim Y as variant ' would variant be correct? Y=shell(cmd.exe /d D:\leerem.bat",1) more code net use d:delete/y ' to disconnect the drive End sub Regards Lee |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Map Network Drive FAO Gary's Student
Hi Lee:
In this case, I suggest creating an external file - leerem.bat that would reside somewhere on your local hard-drive. Ideally, one it has been executed by a user, the D drive should be assigned and will be re-assigned each time the user boots up or logs on. Execute the file by double-clicking the icon. It is possible to execute the file from Excel with a Shell statement in a VBA macro. However, in this case, we want the drive to be assigned BEFORE Excel is started. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi, many thanks for the peice of code as below: net use d:/delete/y net use d:"\bft-123456w\d$"/PERSISTENT:yes pause wherby d:/ is the Drive letter for the Belfast PC? without coming over as thick... you said create a file called leerem.bat containing the code above and then execute the .bat file Question 1: Do you mean create an excel file and write the code in the open workbook section and then save the file as leerem with a .bat extension? Question 2: To execute this .bat file would I write the code as follows; Sub bft() dim Y as variant ' would variant be correct? Y=shell(cmd.exe /d D:\leerem.bat",1) more code net use d:delete/y ' to disconnect the drive End sub Regards Lee |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Map Network Drive FAO Gary's Student
Hi Gary,
to give you the full picture, I have code that looks into at present 12 sites around the country, it locates a file, downloads this file, checks it, and then saves it to my PC in a specific folder for each site for furthur analysis. Once all the sites have been downloaded and saves it consolidates all the files and produces national league tables, which are then used for furthur analysis. New sites are being added as the project expands. At present I manually have to Map all the drives at the beginning of the day so that the code works for each individully assigned drive letter. Sooner or later i will run out of drive letters. How can I, at the begining of each sub eg Sub bft() map the driver letter "B" to this site which will then enable me to download the specific data as long as the PC is switched on of course and upon completion disconnect / delete th Map and then re-assign the same drive letter to another site on the next Sub eg Sub Doncastor() This will ensure I don't run out of drive letters and can add as many sites as required. To create the .bat file is this as Quesion 1 in my previous corrospondance many thanks in anticipation for you patience in this matter Lee "Gary''s Student" wrote: Hi Lee: In this case, I suggest creating an external file - leerem.bat that would reside somewhere on your local hard-drive. Ideally, one it has been executed by a user, the D drive should be assigned and will be re-assigned each time the user boots up or logs on. Execute the file by double-clicking the icon. It is possible to execute the file from Excel with a Shell statement in a VBA macro. However, in this case, we want the drive to be assigned BEFORE Excel is started. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi, many thanks for the peice of code as below: net use d:/delete/y net use d:"\bft-123456w\d$"/PERSISTENT:yes pause wherby d:/ is the Drive letter for the Belfast PC? without coming over as thick... you said create a file called leerem.bat containing the code above and then execute the .bat file Question 1: Do you mean create an excel file and write the code in the open workbook section and then save the file as leerem with a .bat extension? Question 2: To execute this .bat file would I write the code as follows; Sub bft() dim Y as variant ' would variant be correct? Y=shell(cmd.exe /d D:\leerem.bat",1) more code net use d:delete/y ' to disconnect the drive End sub Regards Lee |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Map Network Drive FAO Gary's Student
Under these circumstances, I suggest not using an assigned drive, rather use
the URL directly. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi Gary, to give you the full picture, I have code that looks into at present 12 sites around the country, it locates a file, downloads this file, checks it, and then saves it to my PC in a specific folder for each site for furthur analysis. Once all the sites have been downloaded and saves it consolidates all the files and produces national league tables, which are then used for furthur analysis. New sites are being added as the project expands. At present I manually have to Map all the drives at the beginning of the day so that the code works for each individully assigned drive letter. Sooner or later i will run out of drive letters. How can I, at the begining of each sub eg Sub bft() map the driver letter "B" to this site which will then enable me to download the specific data as long as the PC is switched on of course and upon completion disconnect / delete th Map and then re-assign the same drive letter to another site on the next Sub eg Sub Doncastor() This will ensure I don't run out of drive letters and can add as many sites as required. To create the .bat file is this as Quesion 1 in my previous corrospondance many thanks in anticipation for you patience in this matter Lee "Gary''s Student" wrote: Hi Lee: In this case, I suggest creating an external file - leerem.bat that would reside somewhere on your local hard-drive. Ideally, one it has been executed by a user, the D drive should be assigned and will be re-assigned each time the user boots up or logs on. Execute the file by double-clicking the icon. It is possible to execute the file from Excel with a Shell statement in a VBA macro. However, in this case, we want the drive to be assigned BEFORE Excel is started. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi, many thanks for the peice of code as below: net use d:/delete/y net use d:"\bft-123456w\d$"/PERSISTENT:yes pause wherby d:/ is the Drive letter for the Belfast PC? without coming over as thick... you said create a file called leerem.bat containing the code above and then execute the .bat file Question 1: Do you mean create an excel file and write the code in the open workbook section and then save the file as leerem with a .bat extension? Question 2: To execute this .bat file would I write the code as follows; Sub bft() dim Y as variant ' would variant be correct? Y=shell(cmd.exe /d D:\leerem.bat",1) more code net use d:delete/y ' to disconnect the drive End sub Regards Lee |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Map Network Drive FAO Gary's Student
How do you use the URL: I dont know how this would help. I can use the VNC
but i dont want to go down that avenue. Regards Lee "Gary''s Student" wrote: Under these circumstances, I suggest not using an assigned drive, rather use the URL directly. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi Gary, to give you the full picture, I have code that looks into at present 12 sites around the country, it locates a file, downloads this file, checks it, and then saves it to my PC in a specific folder for each site for furthur analysis. Once all the sites have been downloaded and saves it consolidates all the files and produces national league tables, which are then used for furthur analysis. New sites are being added as the project expands. At present I manually have to Map all the drives at the beginning of the day so that the code works for each individully assigned drive letter. Sooner or later i will run out of drive letters. How can I, at the begining of each sub eg Sub bft() map the driver letter "B" to this site which will then enable me to download the specific data as long as the PC is switched on of course and upon completion disconnect / delete th Map and then re-assign the same drive letter to another site on the next Sub eg Sub Doncastor() This will ensure I don't run out of drive letters and can add as many sites as required. To create the .bat file is this as Quesion 1 in my previous corrospondance many thanks in anticipation for you patience in this matter Lee "Gary''s Student" wrote: Hi Lee: In this case, I suggest creating an external file - leerem.bat that would reside somewhere on your local hard-drive. Ideally, one it has been executed by a user, the D drive should be assigned and will be re-assigned each time the user boots up or logs on. Execute the file by double-clicking the icon. It is possible to execute the file from Excel with a Shell statement in a VBA macro. However, in this case, we want the drive to be assigned BEFORE Excel is started. -- Gary''s Student - gsnu200826 "leerem" wrote: Hi, many thanks for the peice of code as below: net use d:/delete/y net use d:"\bft-123456w\d$"/PERSISTENT:yes pause wherby d:/ is the Drive letter for the Belfast PC? without coming over as thick... you said create a file called leerem.bat containing the code above and then execute the .bat file Question 1: Do you mean create an excel file and write the code in the open workbook section and then save the file as leerem with a .bat extension? Question 2: To execute this .bat file would I write the code as follows; Sub bft() dim Y as variant ' would variant be correct? Y=shell(cmd.exe /d D:\leerem.bat",1) more code net use d:delete/y ' to disconnect the drive End sub Regards Lee |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To Gary's Student | Excel Discussion (Misc queries) | |||
map network drive | Excel Discussion (Misc queries) | |||
To: Gary's Student cell address reply | Excel Discussion (Misc queries) | |||
Is Gary's Student here | Excel Discussion (Misc queries) | |||
Link workbooks-C drive to network drive | Excel Worksheet Functions |