fyi for those using Craig Boyd's awesome CopyToExcel function...

I just added a simple routine to delete Sheet1 and call it just before the CopyToExcel routine is done:

        PROCEDURE DeleteSheet1(tcFile as String)
                IF FILE(tcFile) THEN
                        LOCAL loExcel as Object, loWorkbook as Object
                        loExcel = CREATEOBJECT("Excel.Application")
                        loWorkbook = loExcel.Workbooks.Open(tcFile)
                        IF loWorkbook.Worksheets[1].Name = "Sheet1" THEN
                                loWorkbook.Worksheets[1].Delete
                                loWorkbook.Save()
                                loWorkbook.Close()
                                loExcel.Quit()
                        ENDIF && loWorkbook.Worksheets[1].Name = "Sheet1"
                ENDIF && FILE(tcFile)
        ENDPROC && DeleteSheet1(tcFile as String)

Verified that it works.

Cheers,
--Mike


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to