workbook contents

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
 
N

ncic_1

sorry, I am able to save a copy of my workbook as I described earlie
however I now have a couple problems:

1. I don't want to open the book that was just saved using saved as.
would like it to not open at all if possible.

2. I want the book that I am creating a copy of to stay open and no
close if possible.


Thanks a lot bro'
 
N

ncic_1

ignore my last post I finally got smart and used SaveCopyAs

sorry for the trouble and thanks for the hel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top