code below working on PC and MAC but not working on server. changes are needed?

LT1511

New Member
Joined
Jul 31, 2012
Messages
10
All,
I have this line in my code, which I have tested both on PC and MAC and works fine. I am trying to copy a file from an existing folder called Templates to a newly created folder (see 2nd snipet of code) and renaming it based on the newly created folder name.
Code:
FileCopy ThisWorkbook.Path & Application.PathSeparator & "Templates" & Application.PathSeparator & "PROJECT_DETAIL_SPREADSHEET.xlsm", tr & Application.PathSeparator & .Offset(, -2).Value & "_PROJECT_DETAIL_SPREADSHEET.xlsm"


When I tried to run it on a server, I get an error 76 (Path not found).

I really do not understand why as further up in my code, the following works fine both on Mac / PC as well as on server.

Code:
With Target
            tr = ThisWorkbook.Path & Application.PathSeparator & .Offset(, -2).Value
                MkDir tr
                MkDir tr & Application.PathSeparator & "Name 1 folder"
                MkDir tr & Application.PathSeparator & "Name 2 folder"


I am stumped on this one - any ideas?

Luke

PS:
http://www.excelforum.com/excel-pro...aded-on-server-why.html?p=2879037#post2879037
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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