Jump to content

Page Break


Recommended Posts

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 by PaulG.
Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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

post-949-125501550428_thumb.png

Link to comment

This will work. I use it today. :thumbup1:

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! :thumbup1: 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!)

Link to comment
  • 2 years later...

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

Link to comment

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!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.