Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 10th, 2005, 11:40 AM
mollyg2782 mollyg2782 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 4 mollyg2782 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 21 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Powerpoint code to close Excel file working incorrectly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT