I hope this will not take too much space... Ok, if you want to convert txt file to the xls, you have lucky day. Because new Excel format looks like XML, you easily can create code, which makes something like
<?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <LastAuthor>basad01</LastAuthor> <Created>2009-07-16T07:43:44Z</Created> <Version>11.9999</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>9090</WindowHeight> <WindowWidth>13260</WindowWidth> <WindowTopX>480</WindowTopX> <WindowTopY>30</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font/> <Interior/> <NumberFormat/> <Protection/> </Style> <Style ss:ID="s21"> <Font x:Family="Swiss" ss:Bold="1"/> </Style> </Styles> <Worksheet ss:Name="blbost"> <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="4" x:FullColumns="1" x:FullRows="1"> <Column ss:AutoFitWidth="0" ss:Width="61.5"/> <Column ss:AutoFitWidth="0" ss:Width="120.75"/> <Row> <Cell ss:StyleID="s21"><Data ss:Type="String">Title 1</Data></Cell> <Cell ss:StyleID="s21"><Data ss:Type="String">Title2</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">test1</Data></Cell> <Cell><Data ss:Type="String">test2</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">testA</Data></Cell> <Cell><Data ss:Type="String">testB</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">testX</Data></Cell> <Cell><Data ss:Type="String">testY testZ</Data></Cell> </Row> </Table> <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> <Print> <ValidPrinterInfo/> <HorizontalResolution>200</HorizontalResolution> <VerticalResolution>200</VerticalResolution> </Print> <Selected/> <Panes> <Pane> <Number>3</Number> <RangeSelection>R1C1:R1C2</RangeSelection> </Pane> </Panes> <ProtectObjects>False</ProtectObjects> <ProtectScenarios>False</ProtectScenarios> </WorksheetOptions> </Worksheet> </Workbook> 2009/7/16 Processor Devil <[email protected]> > :D :D, ok, you've won :) > > 2009/7/15 Peter Smith <[email protected]> > > >> On Tue, Jun 30, 2009 at 7:13 AM, Devadula<[email protected]> wrote: >> > >> > hai every body..i need code for window application in vb language for >> > the converting .txt file to .xls file.. >> > >> > Thanks in Advance >> >> You guys are all being too hard on Devadula. >> >> Simple questions demand simple answers. >> >> I haven't done VB since v5, but, here you go. >> ---------------------------------------------------------- >> Private Sub Command1_Click() >> # >> On Error Resume Next >> # >> Name "Devadula.txt" As "Devadula.xls" >> # >> End Sub >> > >
