|
-
Dec 3rd, 2006, 03:40 PM
#1
Thread Starter
New Member
From VB program programmatically insert event procedure into Excel
From VB program programmatically insert event procedure into Excel
I have a group of Excel worksheets that contain many Visual Basic event procedures and modules. I would like to be able to update the code in these worksheet procedures and modules directly from an external Visual Basic program. In the external Visual Basic program I have a routine that defines the Excel worksheet I want to change and have had no problem in extracting or changing information in the Excel worksheet cells. In the external Visual Basic program the following is what I use to access information contained in my Excel worksheets.
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open("C:\Excel\MyWorksheet.xls", , False)
Set xlSheet = xlBook.Sheets(3)
How can I Import, Remove, or Change modules or event procedures to the Excel worksheet from my external Visual Basic program? If anybody knows how to do this would you please provide me with a sample.
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
|