Shortly after submitting this thread, I discovered that a instance of Excel is opened when the action to perform the link is taken. Then once the link to the unbound object is activated the instance of Excel remains open until the link is removed or the form is closed.
If anyone has more info on this and any workarounds for dealing with the open instance of Excel, please let me know.
I have an unbound object frame control on an Access 2010 form that I am using to display a chart from a specific worksheet range in a workbook. It is defined using the following properties:
OLE Type: Linked
OLE Type Allowed: Either
Ole Class: Microsoft Excel 2003
Class: Excel.Chart.8
Update options: Automatic
Display Type: Content
Enabled: Yes
Locked: No
I have using the following code to assign the source parameters for the control.
I must either be able to run this code without leaving the instance of Excel open or have some way to detect that it is open and close it.
Any assistance would be appreciated.
Byron
If anyone has more info on this and any workarounds for dealing with the open instance of Excel, please let me know.
I have an unbound object frame control on an Access 2010 form that I am using to display a chart from a specific worksheet range in a workbook. It is defined using the following properties:
OLE Type: Linked
OLE Type Allowed: Either
Ole Class: Microsoft Excel 2003
Class: Excel.Chart.8
Update options: Automatic
Display Type: Content
Enabled: Yes
Locked: No
I have using the following code to assign the source parameters for the control.
Everything works great to retrieve and display the chart. However, I just discovered that using this code causes an instance of Excel.exe *32 to be left open. The instance is evidently opened when the .Action = acOOECreateLnnk line is executed.Public Function GetOLEChart(sSourceDoc As String, sSourceItem As String, sFormName As String, sFileName As String)
Forms(sFormName).OLEMyExcelSheet.visible = True
DoEvents
With Forms(sFormName).[OLEMyExcelSheet]
.enabled = True
.Locked = False
' Specify what kind of object can appear in the field.
.OLETypeAllowed = acOLELinked
' Class statement--optional for Excel worksheet.
.Class = "Excel.Sheet"
' Specify the file to be linked.
' Type the correct path name.
'.SourceDoc = "C:\DRRBSM\New Books\35000 SUBSIDIARIES.xlsm"
.SourceDoc = sSourceDoc
' Range statement--optional for Excel worksheet.
'.SourceItem = "35000!R1C1:R30C14"
.SourceItem = sSourceItem
' Create the linked object.
.Action = acOLECreateLink
' Optional size adjustment.
.SizeMode = acOLESizeStretch
End With
I must either be able to run this code without leaving the instance of Excel open or have some way to detect that it is open and close it.
Any assistance would be appreciated.
Byron
Last edited: