So, I am new the Mac, and am learning a bit about the unix naming conventions.
Here is my backup macro (BU):
========================================================================================
Sub BU()
Dim MyDate
MyDate = Date
Dim MyTime
MyTime = Time
Dim TestStr As String
TestStr = Format(MyTime, "hh_mm_ss")
Dim Test1Str As String
Test1Str = Format(MyDate, "YY_MM_DD")
Dim filept1, filept2, filept3, filept4, filept5 As String
Application.DisplayAlerts = False
On Error GoTo Errorhandler
filepart1 = "Shared_Folders"
filepart2 = "FCF SHARED"
filepart3 = "Compliance"
filepart4 = "Pre_Project_Tracking"
filepart5 = "Z_Backups"
Fileloc = filept1 & ":" & filept2 & ":" & filept3 & ":" & filept4 & ":" & filept5 & Test1Str & " " & TestStr & ActiveWorkbook.Name
'Fileloc = "Macintosh HD:Users:glj:Documents:fcf_business_temp:backuptest:" & Test1Str & "_" & TestStr & ActiveWorkbook.Name
'MsgBox Fileloc
ActiveWorkbook.SaveCopyAs Filename:=Fileloc
Application.DisplayAlerts = True
Exit Sub
Errorhandler:
MsgBox "More than likely, you are not connected to the network, backup not available"
Application.DisplayAlerts = True
Exit Sub
End Sub
======================================================================================
In Excel 2011, this macro works to backup a file as long as you have a folder called
shared_folders:FCF_Shared:Compliance:Pre_Project_Tracking:Z_Backups
The code runs fine, and the backup folder receives the file with the date and time stamp.
I first wrote the code and wrote the fileloc assignment line using the literal strings.
That worked also.
When I open this workbook in excel, I get the error indicating that it thinks that I have an invalid link. I have no links in this workbook.
The only thing that looks like a path is buried in this code. I wrote the current version as I thought it would not think I had a link if I wrote the path as an expression. Wrong. This is driving me insane. I know it is mistaking this for the link error as when I choose to attempt to update the link, it gives me the expression value for fileloc and then says it can't find it.
glj011848
Bookmarks