Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem with embedded Sheet in VB program

Why not test the type of OLE_keyfig.object

msgbox typename(OLE_keyfig.object)

and see what you have.

From what you describe, it doesn't have a Range property, so it probably
isn't a sheet. It might be a workbook which doesn't have this property.

--
Regards,
Tom Ogilvy

"Frank" wrote in message
...
I am designing an application which update a spreadsheet
that I have embedded in a form in an OlE container
control.
Now, I was hoping to update the spreadsheet through the
application. However, it does not seem that it is really
available through the OLE container.

OLE_keyfig is my container at design time I have embedded
a spreadsheet with the desired format.
Designtime settings for properties:
.Class = "Excel.Sheet.8"
.Autoactivate = "3 - Automatic"
.OLETypeAllowed = "1 - Embedded"
.UpdateOptions = "0 - Automatic"
.SourceDoc points to my original workbook, but once it is
embedded that should not matter (and the file is avaiable)

rs_firma is an active recordset

This is the statement that does not work:

OLE_keyfig.object.Range("B1").Value = rs_firma.Fields
("kundenr").Value

When I run it the following happens:
a. It seems that the spreadsheet is loaded, as I get
asked whether macros should be active or not (standard
when opening)
b. I get an error: Object doesn't support this property
or method (Error 438)

If I go to the debugger and add a watch for
OLE_keyfig.object.Name it is out of context.

Normally, when you have access to a sheet object you can
then get to a Range object, so I do not see why it would
not be valid.

Can anyone give me a hint to how I can access the Sheet.

If it cannot be done, I will instead make my changes to
the external sheet and then have that linked instead of
embedded. But I would prefer to go ahead with my original
idea, if it can be done.


With kind regards,

Frank



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Problem with embedded Sheet in VB program


Bingo! It was a workbook. I guess I jumped to conclusions
because of the class name Excel.Sheet.8.

Thanks for the help.


With kind Regards,

Frank

-----Original Message-----
Why not test the type of OLE_keyfig.object

msgbox typename(OLE_keyfig.object)

and see what you have.

From what you describe, it doesn't have a Range

property, so it probably
isn't a sheet. It might be a workbook which doesn't

have this property.

--
Regards,
Tom Ogilvy

"Frank" wrote in message
...
I am designing an application which update a

spreadsheet
that I have embedded in a form in an OlE container
control.
Now, I was hoping to update the spreadsheet through the
application. However, it does not seem that it is

really
available through the OLE container.

OLE_keyfig is my container at design time I have

embedded
a spreadsheet with the desired format.
Designtime settings for properties:
.Class = "Excel.Sheet.8"
.Autoactivate = "3 - Automatic"
.OLETypeAllowed = "1 - Embedded"
.UpdateOptions = "0 - Automatic"
.SourceDoc points to my original workbook, but once it

is
embedded that should not matter (and the file is

avaiable)

rs_firma is an active recordset

This is the statement that does not work:

OLE_keyfig.object.Range("B1").Value = rs_firma.Fields
("kundenr").Value

When I run it the following happens:
a. It seems that the spreadsheet is loaded, as I get
asked whether macros should be active or not (standard
when opening)
b. I get an error: Object doesn't support this property
or method (Error 438)

If I go to the debugger and add a watch for
OLE_keyfig.object.Name it is out of context.

Normally, when you have access to a sheet object you

can
then get to a Range object, so I do not see why it

would
not be valid.

Can anyone give me a hint to how I can access the

Sheet.

If it cannot be done, I will instead make my changes to
the external sheet and then have that linked instead of
embedded. But I would prefer to go ahead with my

original
idea, if it can be done.


With kind regards,

Frank



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in updating the Powerpoint Embedded Chart with Excel figur Vinod Charts and Charting in Excel 0 May 4th 07 02:19 PM
Links in Embedded doc within sheet don't change when sheet is copi Dan k Excel Discussion (Misc queries) 0 May 11th 06 05:41 PM
Embedded Chart in Excel Sheet George Charts and Charting in Excel 3 August 4th 05 12:19 PM
Problem With Opening Embedded Object After Turning On "Track Chang John A Excel Discussion (Misc queries) 0 August 3rd 05 05:02 PM
problem with embedded pdf file Gary Excel Discussion (Misc queries) 0 January 19th 05 01:57 PM


All times are GMT +1. The time now is 03:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"