embeded excel control doesn't work properly if excel workbook is open through GetObject("xx.xls")

Z

Zhiming H

1. i create the following VB code:
-----------------------------------------
Dim myworkbook As Excel.Workbook
myworkbook = GetObject("c:\temp\control.xls")
myworkbook.Parent.Visible = True
myworkbook.Parent.Windows("control.xls").Visible = True

--------------------------------
The control.xls is very simple excel file which contains two check boxs
controls.

When the control.xls is open, the check value in the check box doesn't
stay when you clicked other cells.

One of reason might be that the GetObject("xcell file name") method
creates a embeded workbook under the excel application, that may cause
the embeded control under the embeded workbook doesn't work properly.

Is there a way to make these embeded control work? Appreciate any help
from your experts.

Regards

Zhiming






*** Sent via Developersdex http://www.developersdex.com ***
 
J

Jim Cone

If you are using VB or VBA (not VB.Net) then
"myworkbook = GetObject("c:\temp\control.xls")"
is missing the Set statement required for all Objects.
It should read...
Set myworkbook = GetObject("c:\temp\control.xls")
--
Jim Cone
Portland, Oregon USA



"Zhiming H"
wrote in message
1. i create the following VB code:
-----------------------------------------
Dim myworkbook As Excel.Workbook
myworkbook = GetObject("c:\temp\control.xls")
myworkbook.Parent.Visible = True
myworkbook.Parent.Windows("control.xls").Visible = True
--------------------------------
The control.xls is very simple excel file which contains two check boxs
controls.

When the control.xls is open, the check value in the check box doesn't
stay when you clicked other cells.

One of reason might be that the GetObject("xcell file name") method
creates a embeded workbook under the excel application, that may cause
the embeded control under the embeded workbook doesn't work properly.

Is there a way to make these embeded control work? Appreciate any help
from your experts.
Regards
Zhiming






*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top