LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need to disable a prompt in Excel when trying to programatically update links in a PPT Presentation that is linked to Excel

I have code that updates graphs in PPT that are linked to data in
Excel. In my code I first open the Excel file that has the linked data
and then open the PowerPoint presentation. Then I have code that
updates the links. See the code below:

Public Sub UpdatePPTLinks(ByVal sPPTFile As String, ByVal sEXLFile As
String)

On Error Resume Next

'EXCEL

ConnectToExcel

'Opens the specified Excel file

Call OpenWorkBook(sEXLFile)

Set objExWB = goXLApp.ActiveWorkbook

'POWERPOINT

'Looks for a running instance of PowerPoint

Set objPPT = GetObject(, "PowerPoint.Application")


If objPPT Is Nothing Then

'Create a PowerPoint instance

Set objPPT = CreateObject("PowerPoint.Application")

If objPPT Is Nothing Then

MsgBox "PowerPoint is not Installed on your System!", vbCritical,
POWERVIEW_TITLE

Exit Sub

End If

objPPT.Visible = True

End If

'Opens the specified PowerPoint file

With objPPT

Set objPresentation = objPPT.Presentations.Open(sPPTFile)

End With



For Each objSlide In objPresentation.Slides

For Each objShape In objSlide.Shapes

If objShape.Type = 7 Then

Set objGraph = objShape.OLEFormat.object

Set objExWB = goXLApp.ActiveWorkbook

If objGraph.Application.HasLinks Then

objGraph.Application.Update

objGraph.Close

End If

End If

Next objShape

Next objSlide



'Shut down Excel

objExWB.Close SaveChanges:=False

Set objExWB = Nothing


'Shut down PowerPoint

objPresentation.save

objPresentation.Close

If objPPT.Presentations.Count = 0 Then objPPT.Quit

Set objPresentation = Nothing

Set objPPT = Nothing


End Sub



However, when the program tries to run through the following line:

Set objGraph = objShape.OLEFormat.object

for some graphs, Excel tries to re-open the Excel file that has the
linked information in it (even though it is already open). I think
this is because it the graph has links that are set to be updated
automatically. I tried changing the links to be set to manual
updating, but then the code doesn't work in updating the links.

When Excel tries to open the workbook again I get the following
message, with the option of clicking YES or NO:

" filename.xls is already open. Reopening will cause any changes you
made to be discarded. Do you want to reopen filename.xls?"

This message pops up for a lot of graphs in the presentation while the
program is running. When I click "No" each time, the graphs update
fine. My problem is that I cannot have this message popping up during
this process which is supposed to run without human intervention.

Does anyone know of anyway to disable this message in Excel?

Or of anything I can change in the code or in my presentation that
will make it not want to reopen up the Excel file again?

SOMEBODY PLEASE HELP ME! - This is at a critical point now!

 
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
Excel 2007 links - update prompt Jen Excel Discussion (Misc queries) 1 June 20th 09 08:05 PM
Do not prompt to update links--Excel 2000 Terry Excel Worksheet Functions 5 February 27th 09 05:24 PM
Update links without being prompt George Excel Discussion (Misc queries) 2 September 12th 07 12:38 AM
Prompt to update links Werner Rohrmoser Links and Linking in Excel 0 November 3rd 05 09:47 AM
Don't prompt to Update Links Dwight[_3_] Excel Programming 0 May 4th 04 10:02 PM


All times are GMT +1. The time now is 11:27 AM.

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

About Us

"It's about Microsoft Excel"