I am trying to embed an excel spreadsheet in an access form and link an external spreadsheet to it. I have found several examples on how to export data to a spreadsheet and import from a spreadsheet but no luck. I have also tried the following :
With Me![OLEExcelSheet]
.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 = "H:\TestOLEAuto.xls"
' Range statement--optional for Excel worksheet.
.SourceItem = "R1C1:R7C4"
' Create the linked object.
.Action = acOLECreateLink
' Optional size adjustment.
.SizeMode = acOLESizeZoom
End With
but get an error when the
.SourceDoc = "H:\TestOLEAuto.xls" line executes. The path is correct. Any suggestions will be helpfull. I am new at programming so laymans terms please.
With Me![OLEExcelSheet]
.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 = "H:\TestOLEAuto.xls"
' Range statement--optional for Excel worksheet.
.SourceItem = "R1C1:R7C4"
' Create the linked object.
.Action = acOLECreateLink
' Optional size adjustment.
.SizeMode = acOLESizeZoom
End With
but get an error when the
.SourceDoc = "H:\TestOLEAuto.xls" line executes. The path is correct. Any suggestions will be helpfull. I am new at programming so laymans terms please.