N
ncic_1
Hi I am trying to dynamically backup a workbook with the backup bein
named according to the month. I have this code so far:
Code
-------------------
Public Sub createBackup()
'this sub will create a monthly backup of AUI to be stored on the server
'call getMonth sub
getMonth
'save the workbook as AUI(Year)monthDigit(monthText)
Dim backupFolderName As String
Dim backupFileName As String
Dim backupFile As String
Dim backupFileContents As Variant
'define backupFolderName based on excel sheet info
backupFolderName = thisWorkBook.Sheets("Calculation Info").Range("H7").Value
'define backupFileName
cleanName = Replace(thisWorkBook.Name, ".xls", "")
backupFileName = cleanName & " - " & monthDigit & " (" & monthText & ")" & ".xls"
'define backupFile
backupFile = backupFolderName & backupFileName
'define backupFileContents
backupFileContents = "what do I put here?"
Open backupFile For Output As #2
Write #2, backupFileContents
Close #2
'MsgBox ("Backedup AUI as: ")
End Sub
-------------------
I just need to know how to reference all the contents of the workboo
that I am backing up. Everything including the vb scripts attached t
the workbook.
Thanks for your hel
named according to the month. I have this code so far:
Code
-------------------
Public Sub createBackup()
'this sub will create a monthly backup of AUI to be stored on the server
'call getMonth sub
getMonth
'save the workbook as AUI(Year)monthDigit(monthText)
Dim backupFolderName As String
Dim backupFileName As String
Dim backupFile As String
Dim backupFileContents As Variant
'define backupFolderName based on excel sheet info
backupFolderName = thisWorkBook.Sheets("Calculation Info").Range("H7").Value
'define backupFileName
cleanName = Replace(thisWorkBook.Name, ".xls", "")
backupFileName = cleanName & " - " & monthDigit & " (" & monthText & ")" & ".xls"
'define backupFile
backupFile = backupFolderName & backupFileName
'define backupFileContents
backupFileContents = "what do I put here?"
Open backupFile For Output As #2
Write #2, backupFileContents
Close #2
'MsgBox ("Backedup AUI as: ")
End Sub
-------------------
I just need to know how to reference all the contents of the workboo
that I am backing up. Everything including the vb scripts attached t
the workbook.
Thanks for your hel