When you say you have embedded I assume you have it embedded as an OLE object.
The best way (or at least from an easy programming point of view) is to add a reference to Excel through project (that way you get to see most of the methods, properties etc of the objects)->references and select Excel Object Library.
Then include the following code:
Dim AppXL As Excel.Application, sFile As String, sPass As String
Dim AppXLWorkSheet As Excel.Worksheet
sFile = "c:\book1.xls" 'replace with your filename
Set AppXL = CreateObject("Excel.Application"
AppXL.Workbooks.Open FileName:=sFile, ReadOnly:=False, password:=sPass
AppXL.Application.DisplayAlerts = False
Set AppXLWorkSheet = AppXL.Workbooks(1).Worksheets(1)
AppXLWorkSheet.Cells(1, 1) = "Hello"
AppXL.Workbooks(1).Save
AppXL.Workbooks(1).Close
Set AppXL = Nothing
This will open a workbook called c:\book1.xls and set cell 1, 1 to be "Hello", if you need anything else please let me know.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.