PC Review


Reply
Thread Tools Rate Thread

Can Excel show OLE object created in DLL of VB6 ?

 
 
chris
Guest
Posts: n/a
 
      16th Dec 2008

In VB6 I created a DLL with a form including an OLE object with Microsoft
excel chart.

When I call this DLL in Excel for showing form, OLE object is blank. It has
data, title etc, I can retrieve their values but cannot see them in OLE
object.

When I call same DLL in Power Point for showing form, OLE object works ok.

Is there any solution for Excel to see chart of OLE object ?

Thanks a lot in advance!
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      16th Dec 2008
The macro language in excel is slightly different in excel from other Office
products. You may need to set some References in the excel VBA menu Tools -
References. I would compare the references that arre enabled in Power Point
with the ones that are enabled in Excel.

"chris" wrote:

>
> In VB6 I created a DLL with a form including an OLE object with Microsoft
> excel chart.
>
> When I call this DLL in Excel for showing form, OLE object is blank. It has
> data, title etc, I can retrieve their values but cannot see them in OLE
> object.
>
> When I call same DLL in Power Point for showing form, OLE object works ok.
>
> Is there any solution for Excel to see chart of OLE object ?
>
> Thanks a lot in advance!

 
Reply With Quote
 
chris
Guest
Posts: n/a
 
      16th Dec 2008
But the commands and references are included in DLL of VB6.. In Excel and
Power Point I just call form for showing OLE object..

"Joel" wrote:

> The macro language in excel is slightly different in excel from other Office
> products. You may need to set some References in the excel VBA menu Tools -
> References. I would compare the references that arre enabled in Power Point
> with the ones that are enabled in Excel.
>
> "chris" wrote:
>
> >
> > In VB6 I created a DLL with a form including an OLE object with Microsoft
> > excel chart.
> >
> > When I call this DLL in Excel for showing form, OLE object is blank. It has
> > data, title etc, I can retrieve their values but cannot see them in OLE
> > object.
> >
> > When I call same DLL in Power Point for showing form, OLE object works ok.
> >
> > Is there any solution for Excel to see chart of OLE object ?
> >
> > Thanks a lot in advance!

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      16th Dec 2008
Thre is an OLE Automation library referenced in both my Power Point and Excel
VBA. I'm not suure if that is included in the DLL. The DLL would only
included not standard items. OLE automation may be consider a standard
library in VB6 but not standard in Excel and Power Point.

"chris" wrote:

> But the commands and references are included in DLL of VB6.. In Excel and
> Power Point I just call form for showing OLE object..
>
> "Joel" wrote:
>
> > The macro language in excel is slightly different in excel from other Office
> > products. You may need to set some References in the excel VBA menu Tools -
> > References. I would compare the references that arre enabled in Power Point
> > with the ones that are enabled in Excel.
> >
> > "chris" wrote:
> >
> > >
> > > In VB6 I created a DLL with a form including an OLE object with Microsoft
> > > excel chart.
> > >
> > > When I call this DLL in Excel for showing form, OLE object is blank. It has
> > > data, title etc, I can retrieve their values but cannot see them in OLE
> > > object.
> > >
> > > When I call same DLL in Power Point for showing form, OLE object works ok.
> > >
> > > Is there any solution for Excel to see chart of OLE object ?
> > >
> > > Thanks a lot in advance!

 
Reply With Quote
 
chris
Guest
Posts: n/a
 
      16th Dec 2008
Unfortunately OLE Automation library is included in DLL, in Excel workbook &
Power Point... In Excel all commands work without any problem, it's just that
OLE object does not show chart...

it seems there is a conflict of OLE object including excel.chart and DLL
being called in Excel...

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      16th Dec 2008
How did you create the Excel Chart as an OLE on a VB6 form

Regards,
Peter T

"chris" <(E-Mail Removed)> wrote in message
news:9437B30C-4DC4-4C13-B810-(E-Mail Removed)...
>
> In VB6 I created a DLL with a form including an OLE object with Microsoft
> excel chart.
>
> When I call this DLL in Excel for showing form, OLE object is blank. It
> has
> data, title etc, I can retrieve their values but cannot see them in OLE
> object.
>
> When I call same DLL in Power Point for showing form, OLE object works ok.
>
> Is there any solution for Excel to see chart of OLE object ?
>
> Thanks a lot in advance!



 
Reply With Quote
 
chris
Guest
Posts: n/a
 
      16th Dec 2008
I created it with 2 ways. With insertable object of Excel chart and with OLE
Container Control. The messages below are for OLE Container Control.

DLL with insertable object, called in Excel needs user to double-click on
chart object to see chart..
DLL with OLE Container Control, called in Excel is blank, while it has
values..

DLL with insertable object, called in Power Point gives error.
DLL with OLE Container Control, called in Power Point works ok.

"Peter T" wrote:

> How did you create the Excel Chart as an OLE on a VB6 form
>
> Regards,
> Peter T
>
> "chris" <(E-Mail Removed)> wrote in message
> news:9437B30C-4DC4-4C13-B810-(E-Mail Removed)...
> >
> > In VB6 I created a DLL with a form including an OLE object with Microsoft
> > excel chart.
> >
> > When I call this DLL in Excel for showing form, OLE object is blank. It
> > has
> > data, title etc, I can retrieve their values but cannot see them in OLE
> > object.
> >
> > When I call same DLL in Power Point for showing form, OLE object works ok.
> >
> > Is there any solution for Excel to see chart of OLE object ?
> >
> > Thanks a lot in advance!

>
>
>

 
Reply With Quote
 
chris
Guest
Posts: n/a
 
      16th Dec 2008
DLL with insertable object and with OLE Container Control, called in Power
Point work ok. My mistake..

Problem is in Excel..

The reason I am trying it from DLL is that I have 2 add-ins, one for Excel &
one for Power point and I am trying to remove duplicate programming code.
Till now I have same code in both add-ins for chart preview. ex. in Excel, I
have a hidden workbook with a chart, from which I export picture of chart
and I assign it to a picture so user has preview of chart before is created.

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      16th Dec 2008
If I follow, in your form load event you are doing something like

Set cht = Me.OLE1.object.Charts(1)

where 'object' is an Excel chart object in the OLE container

How is the VB dll compiled, eg ActiveX or something else

How have you installed or run the dll in Excel

When and where from is the series data sourced.

Regards,
Peter T



"chris" <(E-Mail Removed)> wrote in message
news:4C4BEC73-C8A7-48FD-AFCF-(E-Mail Removed)...
>I created it with 2 ways. With insertable object of Excel chart and with
>OLE
> Container Control. The messages below are for OLE Container Control.
>
> DLL with insertable object, called in Excel needs user to double-click on
> chart object to see chart..
> DLL with OLE Container Control, called in Excel is blank, while it has
> values..
>
> DLL with insertable object, called in Power Point gives error.
> DLL with OLE Container Control, called in Power Point works ok.
>
> "Peter T" wrote:
>
>> How did you create the Excel Chart as an OLE on a VB6 form
>>
>> Regards,
>> Peter T
>>
>> "chris" <(E-Mail Removed)> wrote in message
>> news:9437B30C-4DC4-4C13-B810-(E-Mail Removed)...
>> >
>> > In VB6 I created a DLL with a form including an OLE object with
>> > Microsoft
>> > excel chart.
>> >
>> > When I call this DLL in Excel for showing form, OLE object is blank. It
>> > has
>> > data, title etc, I can retrieve their values but cannot see them in OLE
>> > object.
>> >
>> > When I call same DLL in Power Point for showing form, OLE object works
>> > ok.
>> >
>> > Is there any solution for Excel to see chart of OLE object ?
>> >
>> > Thanks a lot in advance!

>>
>>
>>



 
Reply With Quote
 
chris
Guest
Posts: n/a
 
      16th Dec 2008
Yes, for OLE Container Control I use

Set chrt = ole1.object.Charts(1)
Set exl_WKS = ole1.object.Worksheets(1)

and for insertable object of Excel chart I use

Set chrt = Chart1.object.Charts(1)
Set exl_WKS = Chart1.object.Worksheets(1)

DLL is compiled as ActiveX DLL.

In form load I am assigning some test data for both charts in the worksheet
object retrieved (see above).

exl_WKS.Cells(1, 2).Value = "a"
exl_WKS.Cells(1, 3).Value = "b"
exl_WKS.Cells(2, 2).Value = 500

exl_WKS.Names.Add Name:="Chart_Range", RefersToR1C1:="=" & "R" & "1" & "C"
& "1:" & "R" & "2" & "C" & "3"

exl_chrt.SetSourceData Source:=exl_WKS.Range("Chart_Range"),
PlotBy:=xlRows

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel charts created don't show when e-mailed mainewayne Microsoft Excel Charting 6 29th Jul 2009 04:34 PM
Is there a way to not show the 'date created' on Excel files? =?Utf-8?B?RGFu?= Microsoft Excel Misc 1 11th Apr 2007 02:03 PM
How do I get custom views created in Excel 2K to show in Excel 200 =?Utf-8?B?VGluYSBCcmFkc2hhdw==?= Microsoft Excel Worksheet Functions 0 7th Sep 2005 08:28 PM
how to show created on date in excel? =?Utf-8?B?VmFs?= Microsoft Excel Misc 1 8th Nov 2004 06:26 PM
Attibute in AD to show "WHO" created an object NTNEWS Microsoft Windows 2000 1 23rd Oct 2003 11:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 PM.