View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default ChDrive error (server path)

Hi Marcotte

See
http://www.rondebruin.nl/copy3.htm

Every second macro of each example will also work for a network path

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Marcotte A" wrote in message ...
I have a macro that goes through each file in the folder containing the
workbook and combines their contents together. I used to have this folder on
my computer and it worked fine. I have now moved this folder to a server on
our network, and am getting:

"Run Time Error '5', Invalid Procedure Call or argument."

The path is "\\xxxxx-s2\documents\Marcotte\....."

I recently got a new computer, which was one of the other servers (we used
to have 3, now we have 1). Before, I had to log onto the servers with a
username and password, but since the server/computer change I have not had to
do that.

Sub OpenAll()
'this macro compiles all sbt files in the current directory into a total file
'which can be used to create an IIF.
Dim myPath As String
Dim FNames As String
Dim fs As Object
Dim i As Integer
Dim DlySBTWkb As Workbook
Dim wkb As Workbook
Dim DlyLastRow As Single
Dim MlyLastRow As Single

myPath = ThisWorkbook.Path
ChDrive myPath '.......... <--- generates error
ChDir myPath

'More Code that does the actual work

End Sub

TIA,
Marcotte