help please

steve47

New Member
Joined
Aug 28, 2010
Messages
22
I found this macro code on your site and it does every thing it says it does, but i need it to do a bit more.

Private Sub Workbook_Open()

l = 0
Do
l = l + 1
lastfile = "Work book " & LTrim(Str(l)) & ".XLS"
filetest = Dir("C:\" & lastfile)
Loop Until filetest = ""

NewFileName = "C:\Work book " & LTrim(Str(l)) & ".XLS"

ActiveWorkbook.SaveAs NewFileName

End Sub

How can i make this code look for and use a "Network Drive" called P and then a sub folder called Plant Team, on my company network

The drive i need it access is called Data on totonfs01 '(P)\plant team

Please help an urgent resolution is required at my end

much regards
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
hi thanks for the reply

Yes i can get it to change drives,if the drive is physically attached to the machine i am using. I cannot get it to find the drive when it is a network drive.??

any thoughts
 
Upvote 0
I am sorry but i do not understand any of this.
all i get is error after error, not knowing how to type code is defeating me. what does a bracket do, a full stop i have not got a clue. I have to fins macros that other people have written and use that.

Can you rewrite the above macro i will then copy and paste to try it

Thanks
 
Upvote 0
I am sorry but i do not understand any of this.
all i get is error after error, not knowing how to type code is defeating me. what does a bracket do, a full stop i have not got a clue. I have to fins macros that other people have written and use that.
What is the exact name of your server? You wrote this earlier...

"The drive i need it access is called Data on totonfs01 '(P)\plant team"

but it is hard to tell if the server name I "Data on totnfs01 '(P)" or "totnfs01 '(P}" or maybe even "(P)"... and is that single apostrophe (no matching second one) correct (it looks kind of out of place there)?
 
Upvote 0
hi thanks for trying to help me.
data on totonfs01 (P) this will be the server i would think. all members of staff have access to this "P" Drive we call it.

I am sorry but I will have to check tomorrow the correct punctuation of it. EG one colon or two etc
 
Upvote 0
Data on 'Totonfs01' (P) this is the correct punctuation of the Network Drive.

so how do i get the macro above to look for this?
 
Upvote 0
To get more help I think you will need to tell use the UNC of the folder, eg \\Server\Folder.

WHy wont this work.
Private Sub CommandButton1_Click()

l = 0
Do
l = l + 2
lastfile = "Work Order " & LTrim(Str(l)) & ".XLS"
ChDrive "P:\Toton Plant Team\Plant team work request completed"
filetest = Dir("P:\Toton Plant Team\Plant team work request completed \" & lastfile)
Loop Until filetest = ""
NewFileName = "P:\Toton Plant Team\Plant team work request completed \Work order " & LTrim(Str(l)) & ".XLS"
ActiveWorkbook.SaveAs NewFileName
End Sub
:mad:
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
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