J
jnewl
i am opening an excel application in access and copying an existing excel
workbook. saving the workbook with another name. how do i insert a new
worksheet into the new workbook. tried various approaches with no success
code:
Set xlapp = CreateObject("excel.application")
Set xlsheet = xlapp.workbooks.Open("g:\fee sched test\2009 calendar.xls")
xlapp.activeworkbook.Saveas ("g:\fee sched test\calendar copy.xls")
xlapp.Quit
Set xlapp = Nothing
Set xlsheet = Nothing
Set xlapp = CreateObject("excel.application")
Set xlsheet = xlapp.workbooks.Open("g:\fee sched test\calendar copy.xls")
xlsheet.sheets("sheet1").Add
xlapp.activeworkbook.Save
xlapp.activeworkbook.Close ("g:\fee sched test\calendar copy.xls")
xlapp.Quit
Set xlapp = Nothing
Set xlsheet = Nothing
thanks
workbook. saving the workbook with another name. how do i insert a new
worksheet into the new workbook. tried various approaches with no success
code:
Set xlapp = CreateObject("excel.application")
Set xlsheet = xlapp.workbooks.Open("g:\fee sched test\2009 calendar.xls")
xlapp.activeworkbook.Saveas ("g:\fee sched test\calendar copy.xls")
xlapp.Quit
Set xlapp = Nothing
Set xlsheet = Nothing
Set xlapp = CreateObject("excel.application")
Set xlsheet = xlapp.workbooks.Open("g:\fee sched test\calendar copy.xls")
xlsheet.sheets("sheet1").Add
xlapp.activeworkbook.Save
xlapp.activeworkbook.Close ("g:\fee sched test\calendar copy.xls")
xlapp.Quit
Set xlapp = Nothing
Set xlsheet = Nothing
thanks