Try:
Set wbk = appExcel.Workbooks.Add
' add the sheet and data then
appExcel.SaveAs "C:\MyFolder\emp1.xls"
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
"Janis" <(E-Mail Removed)> wrote in message
news:281E598E-6620-48E6-8B98-(E-Mail Removed)...
>I will reword this to make it simpler to understand. Sorry.
>
> "Janis" wrote:
>
>> 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
>>