Lily
Thu May 08 17:14:01 CDT 2008
What I had before is essentially similar to your method. I had the following:
set wksheet1=XLApplication.workbooks.open(excel filename as
> string).worksheet("ws1")
set wksheet2=XLApplication.workbooks.open(excel filename as
> string).worksheet("ws2")
But at the second line, I got a type mismatch error, which I don't
understand why.
with you method, how can you refer to individual cells in the worksheet, and
especially, if I am using a loop to go over a series of cells?
thanks,
"T Lavedas" wrote:
> On May 8, 3:44 pm, Lily <L...@discussions.microsoft.com> wrote:
> > I used
> >
> > set wksheet1=XLApplication.workbooks.open(excel filename as
> > string).worksheet("ws1")
> >
> > and it did work.
> >
> > But I don't know how to open another worksheet from the same excel file.
> >
> > thanks,
>
> Here this worked for me ...
>
> with createobject("excel.application")
> set oWB1 = .workbooks.open(sXLfilename)'
> oWB1.worksheets(1).activate
> .visible = true
> end with
>
> msgbox "pause"
>
> with createobject("excel.application")
> set oWB2 = .workbooks.open(sXLfilename)'
> oWB2.worksheets(2).activate
> .visible = true
> end with
>
> Entirely different instatiations of the Excel.Application object are
> needed to get simultaneous displays of different sheets in a
> workbook. Only the first one you open will be editable. Later
> versions are opened Read-only. Also, they will appear one over the
> other (the second will hide the first, until it is moved, etc.). I
> didn't take the time to figure out how to move them about.
>
> HTH,
>
> Tom Lavedas
> ===========
>
http://members.cox.net/tglbatch/wsh/
>