General information
Category:
COM/DCOM and OLE Automation
>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
I agree with Borislav. Also, is it possible that they have a permissions issue in creating a new file in this directory?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only