|
-
Oct 30th, 2000, 03:24 AM
#1
Thread Starter
Lively Member
Where can I find some useful sample or reference on how to process an 97 Excel file. eg. I need the common commands for readings, retreiving, moving around the worksheet and write back to this Excel file. It is fairly easy on an Access .mdb but what about Excel?
Regards
-
Oct 30th, 2000, 11:40 AM
#2
Addicted Member
First, add Microsoft Excel to your project references. The code following this will get you started. The best way to learn how to manipulate data is to turn you macro recorder on, do what you want to learn how to do, and then look at the recorded macro. To use this code, just add the prefix for your Excel object to their code.
Private Sub Command1_Click()
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")
Dim xlWS As Excel.Worksheet
xlApp.Workbooks.Open "Path and Name"
Set xlWS = xlApp.ActiveWorkbook.Worksheets.Item(1)
' Do what you want to do here
xlApp.Workbooks.Close
xlApp.Quit
Set xlWS = Nothing
Set xlApp = Nothing
End Sub
-
Oct 30th, 2000, 02:37 PM
#3
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|