msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Saving an Embedded Excel Sheet in an OLE Control

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Prabhakar



Joined: 04 Oct 2007
Posts: 4

PostPosted: Thu Sep 30, 2004 11:59 am    Post subject: Saving an Embedded Excel Sheet in an OLE Control Reply with quote

Hi,
I have an Excel Sheet that gets embedded within an OLE Control on my
VB Form.The Sheet gets displayed perfectly but i am unable to save changes
to the sheet back to the same file.
Here is the piece of code that embeds the excel sheet on the VB Form :
OLE1.Class = "Excel.Sheet.8"
OLE1.Action = OLE_CREATE_EMBED
OLE1.CreateEmbed ("C:\PivotTableReports\SalesAnalysis.xls")

The embeded Worksheet contains a PivotTable
Any thoughts on this.


thanks
prabhakar

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Paul Clement



Joined: 04 Oct 2007
Posts: 1560

PostPosted: Fri Oct 01, 2004 3:52 pm    Post subject: Re: Saving an Embedded Excel Sheet in an OLE Control Reply with quote

On Thu, 30 Sep 2004 07:59:03 -0700, Prabhakar wrote:

¤ Hi,
¤ I have an Excel Sheet that gets embedded within an OLE Control on my
¤ VB Form.The Sheet gets displayed perfectly but i am unable to save changes
¤ to the sheet back to the same file.
¤ Here is the piece of code that embeds the excel sheet on the VB Form :
¤ OLE1.Class = "Excel.Sheet.8"
¤ OLE1.Action = OLE_CREATE_EMBED
¤ OLE1.CreateEmbed ("C:\PivotTableReports\SalesAnalysis.xls")
¤
¤ The embeded Worksheet contains a PivotTable
¤ Any thoughts on this.

See if the following helps:

http://support.microsoft.com/default.aspx?scid=kb;en-us;313812

Not sure whether you can save back to the original file. If the file is embedded (instead of linked)
it won't know anything about the original file.


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Back to top
View user's profile Send private message
Prabhakar



Joined: 04 Oct 2007
Posts: 4

PostPosted: Mon Oct 04, 2004 2:21 pm    Post subject: Re: Saving an Embedded Excel Sheet in an OLE Control Reply with quote

Thanks but OLE1.object.SaveAs ("C:\PivotTableReports\Sample.xls") did not do
anything.

"Paul Clement" wrote:

> On Thu, 30 Sep 2004 07:59:03 -0700, Prabhakar wrote:
>
> ¤ Hi,
> ¤ I have an Excel Sheet that gets embedded within an OLE Control on my
> ¤ VB Form.The Sheet gets displayed perfectly but i am unable to save changes
> ¤ to the sheet back to the same file.
> ¤ Here is the piece of code that embeds the excel sheet on the VB Form :
> ¤ OLE1.Class = "Excel.Sheet.8"
> ¤ OLE1.Action = OLE_CREATE_EMBED
> ¤ OLE1.CreateEmbed ("C:\PivotTableReports\SalesAnalysis.xls")
> ¤
> ¤ The embeded Worksheet contains a PivotTable
> ¤ Any thoughts on this.
>
> See if the following helps:
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;313812
>
> Not sure whether you can save back to the original file. If the file is embedded (instead of linked)
> it won't know anything about the original file.
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
>
Back to top
View user's profile Send private message
Paul Clement



Joined: 04 Oct 2007
Posts: 1560

PostPosted: Wed Oct 06, 2004 2:30 pm    Post subject: Re: Saving an Embedded Excel Sheet in an OLE Control Reply with quote

On Mon, 4 Oct 2004 10:21:04 -0700, Prabhakar wrote:

¤ Thanks but OLE1.object.SaveAs ("C:\PivotTableReports\Sample.xls") did not do
¤ anything.

I've taken a closer look at this and so far I don't see a way to save the changes to an embedded
object. So I took a look at the MS KB and found the following:

PRB: Editing Embedded OLE Object in Place Does Not Save Change
http://support.microsoft.com/default.aspx?scid=kb;en-us;128893

Although the article refers to FoxPro I'm seeing the same behavior for the control in Visual Basic.
It would appear that modifications can only be saved when using a OLE linked document.


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Back to top
View user's profile Send private message
Prabhakar



Joined: 04 Oct 2007
Posts: 4

PostPosted: Thu Oct 07, 2004 10:39 am    Post subject: Re: Saving an Embedded Excel Sheet in an OLE Control Reply with quote

Thanks once again.I did try this on a VB form using a linked object ( as
explained in the article) within the OLE container but it did not save the
changes back. Any more thoughts on this.

thanks
prabhakar


"Paul Clement" wrote:

> On Mon, 4 Oct 2004 10:21:04 -0700, Prabhakar wrote:
>
> ¤ Thanks but OLE1.object.SaveAs ("C:\PivotTableReports\Sample.xls") did not do
> ¤ anything.
>
> I've taken a closer look at this and so far I don't see a way to save the changes to an embedded
> object. So I took a look at the MS KB and found the following:
>
> PRB: Editing Embedded OLE Object in Place Does Not Save Change
> http://support.microsoft.com/default.aspx?scid=kb;en-us;128893
>
> Although the article refers to FoxPro I'm seeing the same behavior for the control in Visual Basic.
> It would appear that modifications can only be saved when using a OLE linked document.
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
how to size the embedded excel application to teh mdi childf hi, i have a problem. i'have an mdichild form with an ole control. i want to call an excel applcation using the ole control. the problem is the excel application is embeddded in the mdichild form but the excel application size is not equal to the mdiform'

OLE Control with Excel I'm using an OLE Control to display an Excel Workbook in my VB6 application. When I Embed the Workbook, it appears in a minimized state. For a view of the Workbook that fills the entire OLE Control, the marquise needs to be dragged manually with the mou

OLE and PowerPoint Embedded Object Is there any way that I can get the path for PowerPoint Embedded Object? I know there is function call for Linked Object but cannot find one for PowerPoint Embedded Object. Please Help! //Grace

replace Excel 2000 -> Excel 2003 I am using the following code to edit data cell by cell: What:="", I get a Microsoft error "Microsoft Excel cannot find any data to replace. Check if your search formatting and criteria are defined correctly. I

Excel chart from VB to Excel Hi I've a Chart object in a VB6 form together with some text boxes, my question is can I "copy" the chart object from the form and place it in a Excel chart ?? I know I can create the chart in a Excel my question is can I
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group