Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I embed a spreadsheet and link data to it in access

Status
Not open for further replies.

adfsmf

Technical User
Sep 19, 2004
7
US
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.
 
The code is correct.
The problem must be in your file path/name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top