Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New FAQs (Excel, Spellcheck, Listbox) 1

Status
Not open for further replies.

jimoo

Programmer
Jun 2, 2003
1,111
US
faq184-4482 Word SpellChecker Example (Version 3)
There are 2 other versions out there already. I added this one right under them so you can easily see all 3 examples. This example uses straight automation (no API calls) and contains only a few lines of code.

faq184-4428 Excel - How to do Automation from VFP
There has been a lot of traffic on this item lately so I added it as a FAQ

faq184-4384 Highlight the first item in a listbox
Please note: tip originated in tek-tip reply by TeknoSDS. It fit well with my other listbox tip.

* A past tip recently modified based on feedback
faq184-4098 Gathering data by quarters

Jim Osieczonek
Delta Business Group, LLC
 
Thank you for the Excel tool ... this is exactly what I need to get started on my project for today. Your timing is exquisite.

 
*Hi jimoo

*Iused your example excel faq in my project. very nice.
*I let the user select the fields(the series data in excel chart and not shown below)


#INCLUDE C:\foxpro\autoOffice\xl5en32.h
local oExcel, oSheet, lnRow,lnCol,lnCol_Count

oExcel = CreateObject("Excel.Application")
oExcel.Visible = .T.
oExcel.Workbooks.Add()

create cursor ctemp ( payitemcode c(8), amount1 n(8), amount2 n(8))

for i = 1 to 30
append blank
replace payitemcode with str(rand()* 10000)
replace amount1 with rand()*1000
replace amount2 with rand()* 500
endfor

select ctemp
go top
oSheet = oExcel.ActiveSheet

lnRow = 1
lnCol = 1
SELECT ctemp
GO TOP
DO WHILE NOT EOF()
lnRow = lnRow + 1
lnCol_Count = fcount()
for lnCol = 1 to lnCol_Count
lcField_name = field(lnCol)
oSheet.Cells(lnRow,lnCol).Value = (&lcField_name)
endfor
skip
enddo
*chart range
oSheet.Range(oSheet.Cells(lnRow,lnCol),oSheet.Cells(lnRow,lnCol)).Select
*******************
thanks for the cool examples
 
Great. Thanks jamrnelson & BeautyLover.

I am glad to give back to the community. I can assure you that folks out there have helped me far more than I will ever be able to repay.

I think the real thanks goes to the VFP community for sharing code so freely, and assisting others with technical issues.

Jim Osieczonek
Delta Business Group, LLC
 
HI, Jimoo

About your FAQ #184-2749 - How to create office header file

After copy and paste your code to my VFP 6.0 and run,
it fails at line # 123:

oTLB_INFO = CREATEOBJECT([tli.typelibinfo])

saying that : Cannot find the class TLI.TYPELIBINFO

Can you give me any idea?

Norman
 
Actually, I didn't write that one. I just referred you to it. It was written by cdms.

However, I just tried it and it worked fine. My first suggestion is to copy all his code in a .prg file again, save it, and run it again. Maybe you missed something.

If that does not work, go to the bottom of the FAQ and press the "Send a Comment to cdms About This FAQ" link. You can send a comment directly to the author, who by default is the expert.





Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top