Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
That doesn't happen on MY machine
Message
From
21/12/2006 15:27:19
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01179645
Message ID:
01179665
Views:
5
The button on the form has this code...

DO m.dir+'progs\gues_label.prg'

Then the program itself...(does some other stuff, then comes the Excel part)
Select labels
Set ORDER TO NAME
Go TOP
Count TO COUNT
If COUNT>0
	m.newfile=m.dir+"data\labels.xls"
	Wait Clear
	oleApp = Createobject("Excel.Application")  && Start Excel.
	oleApp.Workbooks.Add  && Create a workbook.
	oleApp.DisplayAlerts=.f. &&GO SERGEY!!!!!!!!!
        oleapp.Sheets("Sheet3").Select
        oleapp.ActiveWindow.SelectedSheets.Delete
        oleapp.Sheets("Sheet2").Select
        oleapp.ActiveWindow.SelectedSheets.Delete
	Select labels
	Set order to name
	Go Top
	m.rownbr=1
	oleApp.cells(m.rownbr,1).Value="fname"
	oleApp.cells(m.rownbr,2).Value="name"
	m.rownbr=2
	Do While !Eof()
		Scatter Memvar Memo
		oleApp.cells(m.rownbr,1).Value=m.fname
		oleApp.cells(m.rownbr,2).Value=m.name
		m.rownbr=m.rownbr+1
		Select labels
		If !Eof()
			Skip 1
			If !Eof()
				Loop
			Endif
		Endif
	Enddo
	oleApp.ActiveWorkbook.SaveAs(m.newfile)  && Save the workbook.
	oleApp.Quit  &&Quit Excel
	oleApp.DisplayAlerts=.t.
	Wait Clear
***************************
Else
	Messagebox("Records do not exist for month selected, please reselect",16,'')
Endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform