Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel automation and procedures
Message
 
To
20/03/2018 08:39:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01658838
Message ID:
01658857
Views:
55
>>Hi: I am doing excel automation but am finding some discrepancies, I think, so wanted to check out some things.
>>
>>1. I usually begin by making the variable that I will be using for excel, by making it public:
>>
>>PUBLIC oExcel
>>oExcel = CreateObject("Excel.Application") 	
>>
>>
>
>If, by chance, you're doing that because Della and I did it in the Automation book, note that we say clearly that we using a public only for demo purposes. The truth is that a private variable declared and populated in your main program is sufficient, but I prefer to use a property, either of a dedicated automation object, or of the application object.
>
>Tamar

Tamar, It was your book that allowed me to start automating excel. I am using different tabs and procedures because I use one procedure to, for instance, make one histogram showing numbers of A', the same procedure to make a pivot table, showing the # of A's per year, etc. What do you mean, where is it in your book, when you tablk about using a property of either a dedicated automation object or the application object. I missed this part, somehow. But your book is in front of me.

Tore, I have not been releasing any variables that is once I start to work with the workbook but I will double check this.

Greg Green, I can do this at the command line: ADDPROPERTY(_VFP, "oExcel", CreateObject("Excel.Application")), but I also see that if I type oExcel at the command line, intellisense does not recognize it? And a ?VARTYPE(oExcel) shows "U". How do you use: ADDPROPERTY(_VFP, "oExcel", CreateObject("Excel.Application")). Note, I added the missing closing ).

Thank you to all, Steve
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform