Showing results for 
Search instead for 
Did you mean: 

Printing with Excel - PrintArea



I designed a Excel-WorkSheet, defined the printing area and saved it as file.xlsx.


Then  - in LabView - I open Excel and write some data to the cells (OpenExcel, OpenBook, OpenSheet, SetCellValue). But when I print now the excel-sheet via Lab View (Invoke Node -> Print Out) the print area is lost. This means I have a lot of white space on my print. Why does this happen?


Thanks for Help


0 Kudos
Message 1 of 10

Hello Gabriel,

It would be nice to get some more details, could you post your VI? Did you use any examples delivered with LabVIEW?

You can also post your VI in the forum as PNG-Image, which can be sitll used in LabVIEW:



0 Kudos
Message 2 of 10

Hello Ilja,


I used examples I saw in a book (for open Excel an write values).


Here are my VIs. The first is an extract of my main-VI. Case.png


An here the Sub-VI to write the Data to Excel (Icon A(8)->Excel)



Could it be a problem that I'm working with xlsx-files?


0 Kudos
Message 3 of 10

Hello Gabriel,

there should not be any problems with the .xlsx format, as it is just a newer Excel format allowing you to save files with more than 256 columns/rows


Error -2146827284 Occurs When Using Append Table to


I still have no idea what result with "a lot of white space on my print" you get. Please attach a working excerpt with the affected VIs and some test data. I have no time to build it on my own. As written above, VI Snippets would be fine (if you posess LabVIEW 2009 and higher).

Creating VI Snippets in LabVIEW 2009

0 Kudos
Message 4 of 10

Hello Ilja,


I'm sorry, I'm using LabView 8.6.


I append you a VI with the corresponding code.


When you open the attached Excel-File an watch the Print Preview, you see it like this (the printing area are only the yellow cells)

PrintPreview Before Export via LabView.png

After running the VI and inserting some text,

the print Preview is lost, because you see more.

PrintPreview After Export via LabView.png




Download All
Message 5 of 10

Hello Gabriel,

I had no time to have an in-depth look at the vi. But as far as I have seen, working with the standard .xls format works as expected.

0 Kudos
Message 6 of 10



Where have you seen that it works as expected?


I added my VI aggain (with the used librarys from the examples). The content is very simple. I open the excel-file, write into one cell and then take a look on the prinitng preview.contentVI.png


It would be nice if you can take a look at the problem. or should I contact the support via phone?



0 Kudos
Message 7 of 10

Hello fischberg,

as far as you have a support contract with National Instruments, you can call our hotline 089 7413130, by the way I am from department responsible for Germany, Austria and Switzerland.

Telling your Service Request Nummer 950908 you will be redirected to me if possible.


Nevertheless your VI worked when saving to the .XLS format.

0 Kudos
Message 8 of 10

Hey, guys.


I've got the same problem with LabVIEW 2009.

After LabVIEW opens my Excel files the print_area disappears from my templates.


So I have to add it manually:



I know it's too late, but how did you solve it?

Message 9 of 10

Hello guys !

I have the same problem with LabVIEW 2023 and MS office 365. For one prinded page with data, I get 3 blank pages...
The printing area become bigger, instantly after it gets into the "create report" VI.

0 Kudos
Message 10 of 10