ironj32
03-12-2007, 12:47 PM
Had this in a previous thread but didn't get the answer I needed. The following code creates a new copy of an excel file and changes the name. I also need to insert Me.txtVendorName into A1 of "Saved" worksheet of the newely created workbook.
Sub CreateSurvey()
Dim xlWB As Object
Dim xlWS As Object
Dim lRow As Long
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
Set xlWB = CreateObject("Scripting.FileSystemObject")
xlWB.copyfile "D:\Documents and Settings\JLFOGEL\Desktop\Copy of CREVendorMgmtForm1.xls", _
"D:\Documents and Settings\JLFOGEL\Desktop\" & Me.txtVendorName & ".xls"
End Sub
Edited 13-Mar-07 by geekgirlau. Reason: insert line breaks
Sub CreateSurvey()
Dim xlWB As Object
Dim xlWS As Object
Dim lRow As Long
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
Set xlWB = CreateObject("Scripting.FileSystemObject")
xlWB.copyfile "D:\Documents and Settings\JLFOGEL\Desktop\Copy of CREVendorMgmtForm1.xls", _
"D:\Documents and Settings\JLFOGEL\Desktop\" & Me.txtVendorName & ".xls"
End Sub
Edited 13-Mar-07 by geekgirlau. Reason: insert line breaks