R
root729
Version: 2004
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Hi,
I have some code that I have always used on my local mac but now need to run on a second which is networked. The importing of the file was done by simply recording a macro so the file path is set and relative to the HD name. I am not sure if there is a way to map a drive like I used to in PC land on the mac which would solve this problem but I need someway to reference the file on my mac from both macs. If I record the same import text file macro from the second mac the file path is set to only the user name but on my mac I get the full path from the HD. Any ideas on how to go about this? I have found some code which enables me to choose a directory and store that as a string which would work but I cant find out how to insert the value in the string into the path in the code.
The code which has the path is this from the main mac:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Macintosh HD:Users:Tonyownloads:ep.txt", Destination:=Range("A1"))
If I record the same macro on the second mac the resulting code looks like this:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Tonyownloads:ep.txt", Destination:=Range("A1"))
But using the second code on the first mac does not work.
Using the choose folder option I end up with a string but cant work out how to replace the path with a variable name so maybe someone could solve that one for me??
Any help greatly received, so far the only option I can see is to have 2 different files which would work but I am sure there is no need.
Many thanks,
Tony.
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Hi,
I have some code that I have always used on my local mac but now need to run on a second which is networked. The importing of the file was done by simply recording a macro so the file path is set and relative to the HD name. I am not sure if there is a way to map a drive like I used to in PC land on the mac which would solve this problem but I need someway to reference the file on my mac from both macs. If I record the same import text file macro from the second mac the file path is set to only the user name but on my mac I get the full path from the HD. Any ideas on how to go about this? I have found some code which enables me to choose a directory and store that as a string which would work but I cant find out how to insert the value in the string into the path in the code.
The code which has the path is this from the main mac:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Macintosh HD:Users:Tonyownloads:ep.txt", Destination:=Range("A1"))
If I record the same macro on the second mac the resulting code looks like this:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Tonyownloads:ep.txt", Destination:=Range("A1"))
But using the second code on the first mac does not work.
Using the choose folder option I end up with a string but cant work out how to replace the path with a variable name so maybe someone could solve that one for me??
Any help greatly received, so far the only option I can see is to have 2 different files which would work but I am sure there is no need.
Many thanks,
Tony.