Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set Excel decimal point
Message
From
18/02/2007 01:12:33
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01196891
Message ID:
01196898
Views:
8
Thank you Naomi

The code is as below:
                SELECT lcMyDPMD 
                  
                 COPY TO (lcPath) + "_DPMD.xls" TYPE XLS 
                
                 lnStart = RAT("\",lcPath) + 1
                 lnName   = SUBSTR(lcPath,lnStart) + "_DPMD"
                 
                 
                 oEX1 = CREATEOBJECT("Excel.Application")    
                 oEX1.WorkBooks.OPEN((lcPath) + "_DPMD.xls")  
                 oEX1.WorkSheets('&lnName').Activate       
                 
                 lcStaffID = oEX1.CELLS(2,3).Value
                 lcPreName = oEX1.CELLS(2,4).Value
                 lcCurName = lcPreName
                 
                 FOR idx = 2 TO 65536
                     
                     lcCurName = oEX1.CELLS(idx,3).Value
                     
                     IF (ISNULL(lcCurName)) OR (lcPreName <> lcCurName)
                                              
                        oEX1.ActiveSheet.Rows(idx).Insert   
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert
                        oEX1.ActiveSheet.Rows(idx).Insert  
                        
                        IF lnchkPayroll = 1
                           SELECT (lcPayroll)
                           
                           LOCATE FOR ALLTRIM(StaffID) = ALLTRIM(lcStaffID) 

                           oEX1.CELLS(idx+3,1).Value = "Qty"
                           oEX1.CELLS(idx+3,2).Value = Qty
                           oEX1.CELLS(idx+3,3).Value = "BackQTY"
                           oEX1.CELLS(idx+3,4).Value = BackQTY
                           oEX1.CELLS(idx+3,5).Value = "BadQTY"
                           oEX1.CELLS(idx+3,6).Value = BadQTY
                           oEX1.CELLS(idx+3,8).Value = "Amount"
                           oEX1.CELLS(idx+3,9).Value = Amount * 1.0000
                           oEX1.CELLS(idx+3,10).Value = "BadRate"
                           oEX1.CELLS(idx+3,11).Value = BadRate  * 1.0000
                             .
                             .
                             .
                            oEX1.CELLS(idx+5,9).Value = Pay  * 1.0000
                           
                           * oEX1.Visible = .T. 
                           idx = idx + 8
                        ENDIF
                        lcStaffID = oEX1.CELLS(idx,3).Value
                     ENDIF
                                             
                     IF ISNULL(lcCurName)  
                        EXIT
                     ENDIF
                     lcPreName = lcCurName 
                     
                 ENDFOR
                 oEX1.ActiveWorkBook.Save
                 oEX1.ActiveWorkBook.Saved = .T.
                 oEX1.Quit
Experts, thank you in advance again
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform