Results 1 to 4 of 4
  1. #1
    g4tv4life is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    50

    suppressing save message from access to excel charting


    Hey everyone, I have a access database I am using to track radio results. I use a excel sheet to create the chart then export it from the excel to a folder then use that image in the database. The system works great except for one problem I can't fix, the save prompt!
    Here's the code
    Code:
    Public Sub ChartMake()
    Dim xlApp As Excel.Application
    Dim myBook As Workbook
    Dim mySheet As Worksheet
    Dim myChart As ChartObject
     
    Set xlApp = CreateObject("Excel.Application")
    Set myBook = xlApp.Workbooks.Open(GetDBPath() & "Charting.xlsm")
    Set mySheet = myBook.Sheets.Item(1) 'Grab the first worksheet
    xlApp.Visible = False
         mySheet.cells(1, 1).Value = Me.Text33
        mySheet.cells(1, 2).Value = Me.Text34
        mySheet.cells(1, 3).Value = Me.Text35
        mySheet.cells(1, 4).Value = Me.Text36
        mySheet.cells(1, 5).Value = Me.Text37
        mySheet.cells(1, 6).Value = Me.Text38
        mySheet.cells(1, 7).Value = Me.Text39
        mySheet.cells(1, 8).Value = Me.Text40
        mySheet.cells(1, 9).Value = Me.Text41
        mySheet.cells(1, 10).Value = Me.Text42
        mySheet.cells(1, 11).Value = Me.Text110
        mySheet.cells(1, 12).Value = Me.Text109
        mySheet.cells(1, 13).Value = Me.Text83
        mySheet.cells(1, 14).Value = Me.Combo2.Column(2)
        For Each myChart In mySheet.ChartObjects
        myChart.Activate
        
            With xlApp.ActiveChart
            .Export (GetDBPath() & "Images\440 Radio Charts\" & mySheet.cells(1, 13).Value & " " & mySheet.cells(1, 15).Value & ".jpg")
            '.Export (GetDBPath() & "Images\440 Radio Charts\" & Me.Text83 & " " & Me.Combo2.Column(2) & ".jpg")
            End With
            Me.Text140.Value = (GetDBPath() & "Images\440 Radio Charts\" & mySheet.cells(1, 13).Value & " " & mySheet.cells(1, 15) & ".jpg")
        xlApp.Quit
     Set mySheet = Nothing
     Next
     Me.Requery
     Me.Refresh
    End Sub
    It was working fine for a while but now, when a chart is created the message prompt saying Save, don't save or cancel pops up which is beyond annoying. What do i need to add to get rid of the prompt (I don't want to save the data, If it has to be saved to suppress the message, that's fine by me)

  2. #2
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Add this immediately before xlApp.Quit

    xlApp.DisplayAlerts=False

    (that is, if you really don't want to save the workbook).

  3. #3
    g4tv4life is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    50
    Quote Originally Posted by ipisors View Post
    Add this immediately before xlApp.Quit

    xlApp.DisplayAlerts=False

    (that is, if you really don't want to save the workbook).

    That did the trick! Thanks alot, I tried that before but i didn't think to do it after the quit command.

    Cheers!

  4. #4
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    Hi g*,
    Glad that helped, best of luck with the rest of your project.


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Charting Issue
    By Tcurtis in forum Access
    Replies: 1
    Last Post: 03-11-2014, 01:49 PM
  2. Replies: 10
    Last Post: 02-07-2014, 01:29 PM
  3. Replies: 5
    Last Post: 02-03-2014, 03:06 AM
  4. Graphing/Charting - Access vs. Excel
    By Paul H in forum Forms
    Replies: 11
    Last Post: 06-06-2012, 02:43 PM
  5. Replies: 3
    Last Post: 10-15-2009, 12:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums