Gerasimos_Zap
New Member
- Joined
- Sep 23, 2015
- Messages
- 20
I need to write a script to save a worksheet with to a predetermined location and the save name is filled from values within the worksheet. I can get it to save in the proper location, but the file name returns a combination of FATPMetiFolderPath and FATPMetiPath (\Volumes\MFS1\Groups\METI...\METIman\MMP0123 - FATP.xlsm). I can do this just fine with Windows Excel VBA, but I have never used a Mac before. I am programming on a PC, but it needs to be able to be saved properly if used on a Mac.
Code:
[COLOR=#00008B][FONT=Consolas]Sub[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] saveFATPMMMac[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]()[/FONT][/COLOR]
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">[COLOR=#000000]
[/COLOR][COLOR=#808080]'Saves copy for access for everyone[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#00008B]Dim[/COLOR][COLOR=#000000] FATPMetiPath [/COLOR][COLOR=#00008B]As[/COLOR][COLOR=#00008B]String[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#00008B]Dim[/COLOR][COLOR=#000000] FATPMetiFolderPath [/COLOR][COLOR=#00008B]As[/COLOR][COLOR=#00008B]String[/COLOR][COLOR=#000000]
FATPMetiFolderPath [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#800000]"\Volumes\MFS1\Groups\METI\Quality Control\Function and Acceptance Test Documents\METIman\"[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#808080]'FATPMetiFolderPath = "C:\Users\gzapantis\Desktop\"[/COLOR][COLOR=#000000]
FATPMetiPath [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#000000] FATPMetiFolderPath [/COLOR][COLOR=#000000]&[/COLOR][COLOR=#000000] _
Sheets[/COLOR][COLOR=#000000]([/COLOR][COLOR=#800000]"Failure Report"[/COLOR][COLOR=#000000]).[/COLOR][COLOR=#000000]Range[/COLOR][COLOR=#000000]([/COLOR][COLOR=#800000]"FailReportSN"[/COLOR][COLOR=#000000]).[/COLOR][COLOR=#000000]Text [/COLOR][COLOR=#000000]&[/COLOR][COLOR=#800000]" - FATP "[/COLOR][COLOR=#000000]&[/COLOR][COLOR=#800000]".xlsm"[/COLOR][COLOR=#000000]
ThisWorkbook[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]SaveAs Filename[/COLOR][COLOR=#000000]:=[/COLOR][COLOR=#000000]FATPMetiPath
[/COLOR]</code>[COLOR=#00008B][FONT=Consolas]End[/FONT][/COLOR][COLOR=#00008B][FONT=Consolas]Sub[/FONT][/COLOR]