WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Export Excel Data to Tab Delimited Text File


;Winbatch Version: 2006D -- Script by Jay Alverson
#DefineFunction iOpenExcel(wbname)
   Excel = ObjectOpen("Excel.Application")
   Excel.visible = @TRUE
   Excel.displayalerts = @FALSE
   If wbname <> ""
      Excel.Workbooks.Open(wbname)
   Else
      Excel.Workbooks.add
   EndIf
   Return(Excel)
#EndFunction

xfile = "C:\Program Files\Jay\Book1.xls"
tabfile = "C:\Program Files\Jay\Book1_Tab.txt"

xl = iOpenExcel(xfile)
xl.Workbooks(1).Worksheets("Sheet1").select
xl.Workbooks(1).ActiveSheet.cells.select
xl.Workbooks(1).ActiveSheet.cells.copy

FilePut(tabfile, ClipGet())
ClipPut("")
xl.quit

Article ID:   W17154
File Created: 2007:07:03:14:28:30
Last Updated: 2007:07:03:14:28:30