Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To Gary's Student Michael Fosmire [MSFT] Excel Discussion (Misc queries) 2 May 17th 07 02:09 PM
map network drive lumpy04 Excel Discussion (Misc queries) 1 March 15th 07 05:31 PM
To: Gary's Student cell address reply ppbedz Excel Discussion (Misc queries) 5 April 17th 06 10:47 PM
Is Gary's Student here zmr325 Excel Discussion (Misc queries) 8 November 30th 05 12:17 PM
Link workbooks-C drive to network drive Earl Excel Worksheet Functions 0 April 19th 05 05:50 PM


All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"