thanks for your reply!
but I don't understand
Set wkbNew = Workbooks.Add ???
I just write a new code.
like
Dim xlApp1 As Excel.Application
....
Set xlApp = New Excel.Application
xlApp.SheetsInNewWorkbook = 4
xlApp.Workbooks.Add
........
do
if
xlApp.ActiveWorkbook.Works
xlApp.ActiveWorkbook.Works
......
elseif
xlApp.ActiveWorkbook.Works
xlApp.ActiveWorkbook.Works
......
elseif
xlApp.ActiveWorkbook.Works
xlApp.ActiveWorkbook.Works
......
elseif ' I got problem in here
xlApp.ActiveWorkbook.Works
xlApp.ActiveWorkbook.Works
......
else
Loop While Not EOF(1)
xlApp.ActiveWorkbook.Works
xlApp.ActiveWorkbook.Close
xlApp.Quit
Set xlApp = Nothing
But I am not sure is current!!!!so,Could you tell me How to use those method?
sorry to cause your problem.
It is My first to use Visual Basic
before ,I always use the C++.
Thanks ..
best regards
erichuang
Main Topics
Browse All Topics





by: thuanncPosted on 2001-11-25 at 19:50:09ID: 6651870
1. You can set number of sheet in new workbook
heets.Add
xlApp.SheetsInNewWorkbook = 10 'Ten sheet in workbook
Set wkbNew = Workbooks.Add
2. You should navigate valid sheet in sheets collection to access sheets otherwise you may cause error
3. You can add more sheet by following instruction
xlApp.ActiveWorkbook.Works