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)