Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autoupdate of Excel links in Powerpoint from Access VB

Status
Not open for further replies.

GerardHJ

Technical User
Apr 8, 2003
1
CA
I am a newbie to this forum. Also not so experienced in VB, so forgive a stupid question. I have looked at several of the solutions to other likewise problems but can’t see a solution for my problem as yet.

I am working on an Access2000 database, with the intention of getting data automatically in Powerpoint2000, through VB.
Situation: Access database writes data to new Excel sheet, Powerpoint file is already linked to the structure of this excel file. At the end of this the Powerpoint file should open and be automatically updated with the Excel file, then the links should be broken between the Powerpoint and the Excel file, and the Powerpoint file should be saved to a new name.

2 problems:
1. I can’t get the automatic updating to work while opening the Powerpoint file through VB (tried ppUpdateOption but don’t get that to work).
2. I can’t get the links to be broken between Excel sheet and the Powerpoint file

I have tried making a macro in Powerpoint to do this, and then translate that to VB but the macro appeared empty after the updating or breaking of links process...

Current VB listing (the data are just examples):
********************
Private Sub Command0_Click()
If Not [Text1] = "" Then
Set xlobject = CreateObject("excel.application")
xlobject.Visible = True
xlobject.Application.Workbooks.Add
xlobject.Worksheets("Sheet1").Activate
xlobject.Application.ActiveWindow.DisplayGridlines = False
xlobject.Worksheets("Sheet1").Cells(1, 1).Value = Val([Text1])
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("c:\test.xls") = True Then
Kill ("c:\test.xls")
End If
xlobject.Worksheets("Sheet1").SaveAs ("c:\test.xls")
xlobject.Application.Workbooks.Close
xlobject.Quit
xlobject = ""
Set ppobject = CreateObject("powerpoint.application")
ppobject.Visible = True
ppobject.Presentations.Open Filename:="C:\Presentation1.ppt"

'here should the updating of the links come and then the breaking of the links, I guess

Kill ("c:\test.xls")
ppobject.ActivePresentation.SaveAs Filename:="C:\Presentation2.ppt"
ppobject.ActivePresentation.Close
ppobject.Quit
ppobject = ""
End If

End Sub
**************

Can anybody help? Thanks!
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top