Bobillier Posted October 8, 2009 Report Share Posted October 8, 2009 Hi I want creat a data text file and insert a break page between each data blocks. Like that when i open it (convert ) in excel, my data will be on different page. I have try "\f" , but without succes. Any suggestions. Eric Quote Link to comment
Mark Yedinak Posted October 8, 2009 Report Share Posted October 8, 2009 There is no silver bullet answer for your question. It really will depend on what application you will be opening the document in as to what you will need to include in the actual text of the document. Quote Link to comment
PaulG. Posted October 8, 2009 Report Share Posted October 8, 2009 (edited) Your request is a little confusing. Do you want to create a new document (workbook) or a different sheet in a workbook? You can do all of that with ActiveX. And that is a lot easier if you have the Report Generation Toolkit. I've done it in raw ActiveX, but it's work. It's easier just saving different documents as text files. For each new "page" just create a new file name. Edited October 8, 2009 by PaulG. Quote Link to comment
Bobillier Posted October 8, 2009 Author Report Share Posted October 8, 2009 There is no silver bullet answer for your question. It really will depend on what application you will be opening the document in as to what you will need to include in the actual text of the document. In fact i want open it with Excel Your request is a little confusing. Do you want to create a new document (workbook) or a different sheet in a workbook? You can do all of that with ActiveX. And that is a lot easier if you have the Report Generation Toolkit. I've done it in raw ActiveX, but it's work. It's easier just saving different documents as text files. For each new "page" just create a new file name. The computer where i want to put my application don't have Excel and i can't use ActiveX . I just want generate a text file with few breaks page ( in mysterious code) who can be interpret by excel like break page. Regards Quote Link to comment
Phillip Brooks Posted October 8, 2009 Report Share Posted October 8, 2009 The computer where i want to put my application don't have Excel and i can't use ActiveX . I just want generate a text file with few breaks page ( in mysterious code) who can be interpret by excel like break page. Excel treats CSV as a single table (2D). Each line is a record. You can insert page break characters in your CSV file, but Excel has now way of interpreting them. Your CSV will be imported into a single worksheet. I searched a bit, and the best I think you will be able to do is to find/use/write an Excel macro to read the CSV file and import the data line by line. The macro would be responsible for placing data on each sheet. Quote Link to comment
Cat Posted October 8, 2009 Report Share Posted October 8, 2009 I was hoping RTF might do it, but that only works in MSWord. If your target platform is Excel 2007, that version uses a form of XML encoding. If you want to do this the hard way, Microsoft probably has file format info on their website. Otherwise, ActiveX and/or Excel macros are good suggestions. Quote Link to comment
asbo Posted October 8, 2009 Report Share Posted October 8, 2009 It sounds like a few of you are mixing up page breaks with new worksheets altogether. Quote Link to comment
Phillip Brooks Posted October 8, 2009 Report Share Posted October 8, 2009 If your target platform is Excel 2007, that version uses a form of XML encoding. If you want to do this the hard way, Microsoft probably has file format info on their website. Otherwise, ActiveX and/or Excel macros are good suggestions. There is one other way to get data into an Excel file; using ADO. You can open an existing XLS file via ADO, and then use UPDATE calls to write the the table/record/field (worksheet/row/column). I can't share my ADO library, but you can use one of the libraries from LAVA or the NI forums, then create a UDL that points to an Excel file; use ADO Execute calls with a SQL UPDATE statements... UDL Connection String: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;Extended Properties="Excel 8.0;HDR=No";Persist Security Info=False Quote Link to comment
asbo Posted October 8, 2009 Report Share Posted October 8, 2009 There is one other way to get data into an Excel file; using ADO. That won't work since he doesn't have Excel installed, though, right? Quote Link to comment
ShaunR Posted October 8, 2009 Report Share Posted October 8, 2009 (edited) Even Excel cannot save its own page breaks to a text file. Edited October 8, 2009 by ShaunR Quote Link to comment
Phillip Brooks Posted October 8, 2009 Report Share Posted October 8, 2009 That won't work since he doesn't have Excel installed, though, right? This will work. I use it today. You're not using Excel to read/write to the spreadsheet, you're using ADO. My lab computers only have OpenOffice Calc, no Excel installed. How To Use ADO with Excel Data from Visual Basic or VBA Quote Link to comment
asbo Posted October 8, 2009 Report Share Posted October 8, 2009 This will work. I use it today. You're not using Excel to read/write to the spreadsheet, you're using ADO. My lab computers only have OpenOffice Calc, no Excel installed. How To Use ADO with Excel Data from Visual Basic or VBA Very cool! For some reason, I thought the OLE provider needed some sort of extension from the Excel install. (And I actually skimmed that very article before posting - oops!) Quote Link to comment
Endeavour Posted August 27, 2012 Report Share Posted August 27, 2012 Dear all, I've got the same need: to parse & save a few long ASCII files into one XLS multi worksheet file. I've tried the ActiveX solution and found it works tooooooo sloooooooow by executing my simple task. Thanks to this topic and Phillip Brooks I've learned about "ADO Toolkit". I've checked it, but have got an error warning: "Error -2147467259 occurred at Exception occured in Microsoft OLE DB Provider for ODBC Drivers: System error 126 (Microsoft Excel-Treiber (*.xls)) the driver couldn't be loaded in ADOTool_ADO API.vi->ADOTool_Open Excel Database.vi->dir_of_txt_to_multi_worksheet_xls_c.vi" Heir are the attachments: the block diagram and VI. Unfortunately I couldn't debug my vi with myself and would appreciate any suggestions! P.S. I use LabView 8.0 SE with ADO-Tool.1.5.LV80 Quote Link to comment
asbo Posted August 27, 2012 Report Share Posted August 27, 2012 Check what version of Microsoft Jet you have installed. Your version of Windows may also play a role. Make sure the path to your data source is correct. Quote Link to comment
Endeavour Posted August 27, 2012 Report Share Posted August 27, 2012 Could be a problem. I've no Msjet40.dll in my WInXP system and the owner link is dead. How can I safely get it? Quote Link to comment
asbo Posted August 27, 2012 Report Share Posted August 27, 2012 You could try contacting Microsoft support directly. I'm sure someone else is hosting it elsewhere, but it may be a little fishy to pull it from another site. If you have the patience, I'd go with the former. Or you could use the Wayback Machine. http://web.archive.org/web/20100722104106/http://support.microsoft.com/kb/829558 Quote Link to comment
Endeavour Posted August 27, 2012 Report Share Posted August 27, 2012 Thank you asbo! I've got it and would try my best againg after sys fix. Quote Link to comment
Endeavour Posted August 27, 2012 Report Share Posted August 27, 2012 Check what version of Microsoft Jet you have installed. Your version of Windows may also play a role. Make sure the path to your data source is correct. I'm working under MS WinXP Pro SP3. Have got a MS Jet 4.0, but also after thet still have the same error warning "Error -2147467259" after "Open Excel DB" node. What can be a trigger of it? Please, help! Quote Link to comment
asbo Posted August 27, 2012 Report Share Posted August 27, 2012 I don't have any other insight for you. Try researching the error code and see if you can find out more about its root causes. Windows errors codes are often referred to in hex, so 0x80004005 in this case. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.