|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Powerpoint code to close Excel file working incorrectly
Hello,
I am trying to automate a process that runs an access query, transfers the spreadsheet to an excel page, populates charts and graphs, and then uses these charts and graphs with other formatting to create PowerPoint slides. Although my code seems to work well, when I log off the computer I am prompted to save changes for an "open" excel file, although it doesn't appear to be open. I think this is creating problems with my transferspreadhseet function in Access, because I am getting the error message "Too Many Fields Defined". Here is a sample of my ppt code: Set xlApp = CreateObject("Excel.Application") Set xlWrkBook = xlApp.Workbooks.Open("\\Sfa19\bpmd$\Reporting\Patient Reporting - TSI\Patient Financial Reporting\Template Databases\Charts Master template.xls") ' Create a new slide ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitleOnly).SlideIndex ' Copy picture of the 1st chart object onto the clipboard xlWrkBook.Worksheets("IP Variance Chart").ChartObjects("IP Variance Chart").Chart.CopyPicture and so on.... until I reach the end of my code: ' Close the open workbook without saving changes xlWrkBook.Close (False) xlApp.Quit Set xlApp = Nothing Set xlWrkBook = Nothing I a wondering if I am opening the Excel file too many times and am missing code that would work better?? Your help is so much appreciated!! Thanks |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Powerpoint code to close Excel file working incorrectly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|