| View previous topic :: View next topic |
| Author |
Message |
Carl Yang Guest
|
Posted: Tue Sep 07, 2004 1:50 am Post subject: How to set excelapplication.activeworkbook by program ? |
|
|
Hello:
I want to load several excel files at the same time and use tabcontrol to switch activeworkbook, but the activeworkbook property is readonly...
I have tried and found that I can do this with just open the file again (i.e excelapp.workbooks.open(....)) and the workbooks.count wouldn't grow up, but this take too much time because the system seems to read the file again.
Please help me how to set the activeworkbook by program ?
Environment: D7
texcelapplication property:
autoconnect : true
autoquit : true
connectkind : ckRunningOrNew
Any suggestion would be appreciated and thanks a lot in advance.
Carl
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 07, 2004 3:21 am Post subject: Re: How to set excelapplication.activeworkbook by program ? |
|
|
| Quote: | I want to load several excel files at the same time and use tabcontrol
to switch activeworkbook, but the activeworkbook property is readonly... |
In excel you select the relevant tab, eg:
Sheet1.Select (or whatever you have called the worksheet)
Oliver Townshend
|
|
| Back to top |
|
 |
Carl Yang Guest
|
Posted: Wed Sep 08, 2004 1:43 am Post subject: Re: How to set excelapplication.activeworkbook by program ? |
|
|
| Quote: | In excel you select the relevant tab, eg:
Sheet1.Select (or whatever you have called the worksheet)
|
Hello:
Thanks for your response.
The select works for sheet selection.
But I try to select one excel workbook from workbooks collection, and the _workbook type not support select method..
I also find that there is a type TexcelOleobject with select method but I can't find how to convert _workbook to _oleobject
or Texceloleobject.
Please help me: how to select one workbook from workbooks collection and set it as activeworkbook ?
Thank you very much !
Carl Yang
|
|
| Back to top |
|
 |
Carl Yang Guest
|
Posted: Wed Sep 08, 2004 2:21 am Post subject: Re: How to set excelapplication.activeworkbook by program ? |
|
|
Hello:
I have found what I want on MSDN online:
just set workbooks[index].active(lcid)
so simple... :)
Thanks for everyone.
Carl
|
|
| Back to top |
|
 |
|