J
Janis
I have this snippet which works to open the named workbook and tab.
Set appExcel = Excel.Application
appExcel.Visible = True
Set wbk = appExcel.Workbooks.Open("emp.xls")
Set wks = appExcel.Worksheets("Employees1")
What I need is to know how to create the workbook and sheet in Access/VBA if
the workbook/sheet do not exist? If possible can you give me an example? I
tried the Create method instead of Open and tried to Add a worksheet named
Employees1 and it didn't work.
tia,
-----------------
Set appExcel = Excel.Application
appExcel.Visible = True
Set wbk = appExcel.Workbooks.Create("emp1.xls")
Set wks = appExcel.Worksheets.Add("Employees1")
wks.Activate
Set appExcel = Excel.Application
appExcel.Visible = True
Set wbk = appExcel.Workbooks.Open("emp.xls")
Set wks = appExcel.Worksheets("Employees1")
What I need is to know how to create the workbook and sheet in Access/VBA if
the workbook/sheet do not exist? If possible can you give me an example? I
tried the Create method instead of Open and tried to Add a worksheet named
Employees1 and it didn't work.
tia,
-----------------
Set appExcel = Excel.Application
appExcel.Visible = True
Set wbk = appExcel.Workbooks.Create("emp1.xls")
Set wks = appExcel.Worksheets.Add("Employees1")
wks.Activate