Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a spreadsheet from Foxpro using Object Model
With the push from a button on one of my FoxPro forms
using the Excel automation (object model), I create an employee listing on a spreadsheet that will be sent to a client. I protect the sheet so that the client cannot edit the listing, but I want them to be able to add a NEW entry (employee) into the listing if needed. So, in the VFP code that's creating the spreadsheet, I want to add a button that will: -Unprotect the spreadsheet -Insert a new row and "unlock" that row -Protect the spreadsheet again with the password I think I know how to add a button to the spreadsheet through my code, but I don't know how to add the 'Click' event code for the button from within my VFP code. I've read the 'MS Office Automation with VFP' book and it doesn't help. This has to be entirely automated (no actual Excel interaction). Please help...any examples (VBA or VFP code) would be welcome. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a spreadsheet from Foxpro using Object Model
Scott
If you're using the OLE commandbutton, then have a look here. http://www.cpearson.com/excel/vbe.htm You need to find the correct VBComponent (the sheet on which the button will be inserted) and add code to its CodeModule like Private Sub CommandButton1_Click() 'Stuff End Sub You may want to do it manually to see the correct syntax for the Click event. Post back if you get stuck. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Scott" wrote in message ... With the push from a button on one of my FoxPro forms using the Excel automation (object model), I create an employee listing on a spreadsheet that will be sent to a client. I protect the sheet so that the client cannot edit the listing, but I want them to be able to add a NEW entry (employee) into the listing if needed. So, in the VFP code that's creating the spreadsheet, I want to add a button that will: -Unprotect the spreadsheet -Insert a new row and "unlock" that row -Protect the spreadsheet again with the password I think I know how to add a button to the spreadsheet through my code, but I don't know how to add the 'Click' event code for the button from within my VFP code. I've read the 'MS Office Automation with VFP' book and it doesn't help. This has to be entirely automated (no actual Excel interaction). Please help...any examples (VBA or VFP code) would be welcome. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA: Where to find Excel Object model? | Excel Discussion (Misc queries) | |||
"Excel.Application" Object Model | Charts and Charting in Excel | |||
Freeze Panes with Object Model | Excel Programming | |||
Does MS Query have an object model | Excel Programming | |||
Accessing the VBA project object model | Excel Programming |