Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Identify excel embedded charts in powerpoint

Hello,

I would like to identify vith a VBA code, if the chart that i am editing is
is embedded in a powerpoint presentation or if is just an excel file opened
by excel.

My point is to fix the color chart bugs between 2003 and 2007 powerpoint
version.
I would like to reset the color index, if Ia m editing an Excel chart from
powerpoint (wich bugs)

I have tryed the workbook.container property, but it does not work when you
edit a chart in Excel (I don't understand the purpose of this excel function
that dies not work in excel ,,,)

Any idea ??

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Identify excel embedded charts in powerpoint

If you only need to know if the Workbook is embedded is to check its
IsInPlace property, False if opened in Excel otherwise True. If you need to
know the name of the parent app check the wb's Container name (under an
error handler 'cos it'll error in Excel).

With both methods, if you need to know in the wb's open event postpone and
check in an OnTime macro called from the open event.

b = wb.IsInPlace
On error resume next
s = wb.Container.Name
On error got to 0
If len(s) then etc

Regards,
Peter T

"Nicolo" wrote in message
...
Hello,

I would like to identify vith a VBA code, if the chart that i am editing

is
is embedded in a powerpoint presentation or if is just an excel file

opened
by excel.

My point is to fix the color chart bugs between 2003 and 2007 powerpoint
version.
I would like to reset the color index, if Ia m editing an Excel chart from
powerpoint (wich bugs)

I have tryed the workbook.container property, but it does not work when

you
edit a chart in Excel (I don't understand the purpose of this excel

function
that dies not work in excel ,,,)

Any idea ??

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Identify excel embedded charts in powerpoint

Thanks Peter.

the is in place works fine.
but the container errors as in Excel but I'll do it with is in place only.

Other question.
Do you know how I could launch a Sub every time a new workbook is open.
I have included this scipt in the auto open section of an add-in.
I can identify the cases when i need to launch my sub that changes the color
index / color theme (necessary only when I display an excel graph embedded in
Powerpoint)

If I include directly my sub in the auto open (which includes
activeworkbook.colors...), it does not work, because when the add in is
loaded, there is not yet any active book....

IS there a way to put in a single addin a sub that will be lauched every
time a new workbook is opened or created ??


"Peter T" wrote:

If you only need to know if the Workbook is embedded is to check its
IsInPlace property, False if opened in Excel otherwise True. If you need to
know the name of the parent app check the wb's Container name (under an
error handler 'cos it'll error in Excel).

With both methods, if you need to know in the wb's open event postpone and
check in an OnTime macro called from the open event.

b = wb.IsInPlace
On error resume next
s = wb.Container.Name
On error got to 0
If len(s) then etc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Identify excel embedded charts in powerpoint

As I mentioned previously it's best to postpone open event code until
everything is in-place! You can do this with an onetime macro like this -

Sub auto_open()

Application.OnTime Now + TimeSerial(0, 0, 2), "MyAfterOpenMacro"

End Sub

Sub MyAfterOpenMacro()
Dim wb As Workbook

MsgBox "MyAfterOpenMacro"
Set wb = ThisWorkbook

If wb.IsInplace Then
' do stuff
End If

End Sub

You might not need the two second delay in the above example as the Ontime
macro will fire when all else is done, in a manor of speaking.

Regards,
Peter T

"Nicolo" wrote in message
...
Thanks Peter.

the is in place works fine.
but the container errors as in Excel but I'll do it with is in place only.

Other question.
Do you know how I could launch a Sub every time a new workbook is open.
I have included this scipt in the auto open section of an add-in.
I can identify the cases when i need to launch my sub that changes the
color
index / color theme (necessary only when I display an excel graph embedded
in
Powerpoint)

If I include directly my sub in the auto open (which includes
activeworkbook.colors...), it does not work, because when the add in is
loaded, there is not yet any active book....

IS there a way to put in a single addin a sub that will be lauched every
time a new workbook is opened or created ??


"Peter T" wrote:

If you only need to know if the Workbook is embedded is to check its
IsInPlace property, False if opened in Excel otherwise True. If you need
to
know the name of the parent app check the wb's Container name (under an
error handler 'cos it'll error in Excel).

With both methods, if you need to know in the wb's open event postpone
and
check in an OnTime macro called from the open event.

b = wb.IsInPlace
On error resume next
s = wb.Container.Name
On error got to 0
If len(s) then etc



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
updating embedded powerpoint in excel file txm49 Excel Discussion (Misc queries) 0 September 24th 09 08:16 PM
Embedded Excel Objects in PowerPoint resize after editing Barb Reinhardt Excel Discussion (Misc queries) 0 September 21st 09 06:41 PM
Unable to view embedded excel data in either Powerpoint or Word RD[_2_] Excel Discussion (Misc queries) 2 May 16th 08 06:01 PM
Problem in updating the Powerpoint Embedded Chart with Excel figur Vinod Charts and Charting in Excel 0 May 4th 07 02:19 PM
Error closing embedded Excel workbook in PowerPoint Gail Hurn Excel Programming 2 November 24th 04 04:41 PM


All times are GMT +1. The time now is 11:27 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"