LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert pagebreake to excel report

Solved!
Go to solution

Hi 

I try to add pagebreak in excel report , but i get error code -2147352571 right after invoke node used to add this page break., 

in this vi i calculate the cell where i want to add this page break and add some text one cell before' is there any other way to add page break?

Regards 

Idan 

add pagebreakadd pagebreak

0 Kudos
Message 1 of 5
(2,576 Views)

Have you investigated how (in Excel itself) to insert a Page Break?  There is a method, but I have no idea what it really does (it seems unlikely that it adds a <Vertical Tab>, as the same command also seems to be used to add horizontal page breaks (<Horizontal Tab>), a different Ansi character ...

 

There are also Excel macros that might do this.  Note that you are starting to "push the boundaries" of what the Report Generation Toolkit can do and also what it is designed to do (this is not meant as a criticism of your actions, but a plea not to be mad at NI if it doesn't do "everything" you might want ...).

 

Bob Schor

0 Kudos
Message 2 of 5
(2,564 Views)
Solution
Accepted by topic author idans

The "Before" input of the VPageBreaks:Add method should be a Range reference rather a cell address.  Use the _Worksheet:Range method with the cell address as "Cell1" input to obtain the reference and pass it to the invoke node (no need to explicitly convert to a variant).

 

Excel Page Break.png

 

Andy

0 Kudos
Message 3 of 5
(2,562 Views)

Hi Bob

yes i looked in excel documentation and I found Hpagebreake property ,you can see in this link https://docs.microsoft.com/en-us/office/vba/api/excel.vpagebreaks.add ' in their example it look very strait forward , but in labview i get this error that nean type mismatch, but what that means?  if what i did is pushing toolbox limit? i dont know.  

0 Kudos
Message 4 of 5
(2,558 Views)

thanks andy it worked

0 Kudos
Message 5 of 5
(2,546 Views)