Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > Powerpoint MSGraph Datasheet Link


Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2003, 07:20 PM
JoshuaG JoshuaG is offline
Newcomer
 
Join Date: Oct 2003
Posts: 9
Question Powerpoint MSGraph Datasheet Link


I'm trying to break a link programmatically in VBA for Powerpoint. This is not a linked object itself. The chart is MSGraph and the datasheet is linked to a worksheet in Excel. It's simple to edit the graph and select "links" and "break link" from the menu, but I've got hundreds of them to do so I'm trying to figure out how to do it programmatically. I can see the "haslinks" property of the msgraph application object is set to true, but I can't figure out how to unlink it. I can't see any of the link information (application, sourcename, etc.) when I try to watch the object so I'm stumped as to how to do this. Any suggestions? Thanks.
Reply With Quote
  #2  
Old 11-07-2003, 12:04 PM
JoshuaG JoshuaG is offline
Newcomer
 
Join Date: Oct 2003
Posts: 9
Unhappy

I can get it to work most of the time using sendkeys, but it's sloppy and relies on the user not touching the keyboard. Still, here's a partial answer to my own question. By the way, I made it into an add-in so my users can jus select it from a menu on the current presentation.

Code:
Sub BreakDataSheetLinks() Dim msgApp As Graph.Application Dim sldCurrent As Slide Dim shpCurrent As Shape Dim msgResult As VbMsgBoxResult Dim vueType As PpViewType msgResult = MsgBox("This add-in has only tested effective on presentations " & _ "that have been just opened, but not yet viewed or modified. Click OK if " & _ "you want to continue with this add-in or Cancel if you want to save/close " & _ "and re-open this presentation.", vbOKCancel) If msgResult = vbOK Then vueType = ActiveWindow.ViewType ActiveWindow.ViewType = ppViewNormal ActiveWindow.Panes(1).Activate For Each sldCurrent In ActivePresentation.Slides ActiveWindow.View.GotoSlide sldCurrent.SlideIndex For Each shpCurrent In sldCurrent.Shapes If shpCurrent.Type = msoEmbeddedOLEObject Then If Left(UCase(shpCurrent.OLEFormat.ProgID), 7) = "MSGRAPH" Then Set msgApp = shpCurrent.OLEFormat.Object.Application If msgApp.haslinks Then msgApp.Visible = True msgApp.WindowState = xlNormal msgApp.WindowState = xlMaximized DoEvents DoEvents DoEvents DoEvents DoEvents DoEvents SendKeys "{F10}" DoEvents SendKeys "V" DoEvents SendKeys "D" DoEvents DoEvents DoEvents DoEvents DoEvents DoEvents DoEvents DoEvents SendKeys "{F10}" DoEvents SendKeys "E" DoEvents SendKeys "K" DoEvents SendKeys "B" DoEvents SendKeys "Y" DoEvents SendKeys "{ESC}" DoEvents msgApp.Update msgApp.Quit DoEvents End If Set msgApp = Nothing End If End If Next Next ActiveWindow.ViewType = vueType End If MsgBox "Done!", vbOKOnly, "BreakDataSheetLinks" End Sub

Last edited by JoshuaG; 11-07-2003 at 04:31 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP!!! - Past link from VB to a other soft with past link. frech General 2 05-04-2003 07:01 PM
Visual Basic & Powerpoint fikha General 1 01-09-2003 02:51 PM
Making a non-underlined link nickg96 Web Programming 1 01-01-2003 03:04 PM
Running a PowerPoint Presentation from VB smithb Word, PowerPoint, Outlook, and Other Office Products 12 03-02-2002 11:10 AM
WebBrowser1 copy link to text1 coder2002 Communications 1 01-25-2002 07:41 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->