Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Intellisence with excel
Message
From
04/06/2010 07:24:48
 
 
To
04/06/2010 07:16:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01467305
Message ID:
01467315
Views:
42
>>hi everybody,
>>
>>
>>i want intellisence to have properties , method in my programm but since succes.
>>
>>
>>PUBLIC  oExcel AS OBJECT OF "Excel.APPLICATION"
>>     
>>     oExcel.     && ctrl + J does not work
>>
>>
>>
>>how can i do it ?
>>
>>
>>bernhart
>
>Do not use public with Excel (you will soon experience why not if you do):
>
>
>
>local oExcel as 'Excel.Application', ;
>oWorkBook as 'Excel.WorkBook', ;
>oSheet as 'Excel.WorkSheet'
>
>oExcel = CREATEOBJECT('Excel.Application')
>WITH oExcel as 'Excel.Application'
>    * oWorkBook = .Workbooks.Add()
>    WITH .Workbooks.Add() as 'Excel.WorkBook'
>    	* oSheet = .ActiveSheet
>    	with .ActiveSheet as 'Excel.WorkSheet'
>    		* .
>    	endwith
>    ENDWITH
>endwith
>
But though working with intellisense this way helps, I think you can't get so much deeper easily with it is object model (saying easily I mean it is cumbersome to specify all those as blahblah series when Excel have tons of objects). One thing I find easy is, instead of using 'as ...' I :
>-suspend the code at a point with set step on
>-Size the VFP and Excel windows so I can see both
>-Go to command window
>-Assign some object to a variable
>-Type in command window (even if I had no "as ..." and no matter how deep it is in object hiearchy) and I get intellisense there
>-Execute the code there and either get an error or if it is right see the result in Excel interactively
>-When satisified, copy the code from command window and put in production code
>
>That is the best working code writing for me when it is Excel, Word or any other non-VFP COM object.
>Cetin

Cetin,

have you been looking over my shoulder when I have programmed? :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform