Hey all – self teaching VBA but only posting here as a last resort as I cannot find the answer.
The following code from my access 2002 database opens a workbook then adds a new work sheet that i can then write stuff to. But what i need to to is open the workbook then copy and existing worksheet to write stuff. This is doing my head in. Can anyone help ??
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(“c:\somefile.xls”)
Set xlSheet = xlBook.Worksheets.Add
xlSheet.Cells(1, 5).Value = “Gday!”
Thanks and Regards
MB