LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Chart Header/Footer

I am having a really hard time trying to write to the chart header and footer using Active X.  I have an excel file that I want to use as a template to write my data to.  In this file I have some sheets and some charts that have their source data tied to a sheet and the cells on the sheet.  I can write my data through Active X to the sheets and enter my header and footer without a problem.  I can even select the the charts and print them, but when I try to write headers and footers to the charts nothing happen.  I get no error messages or anything.  I currently select the chart and then use the PageSetup property to write to the header information just like I am doing for the individual sheets, but for some reason this does nothing.  Also I tried changing the chart title and stuff like that and I get nothing too.  Can anyone tell me what I am doing wrong?  I can't seem to figure out what I am missing.
0 Kudos
Message 1 of 7
(3,433 Views)

Hi tct1375,

Could you post a snippet of code that shows what works with the worksheets, and what's not working with the charts?  Thanks!

Regards,

James R.
National Instruments
0 Kudos
Message 2 of 7
(3,406 Views)

Sorry for the late response, my code are on my computer at work so I couldn't respond over the weekend.  Here is a copy of the spreadsheet and the code I use to write to the sheet's header/footer and the code for writing to the chart's header/footer.  Please let me know what is wrong and if you need anything else from me.  Thank

Tom

0 Kudos
Message 3 of 7
(3,386 Views)
To modify the chart headers and footers, I had to change the numeric control (input into the Sheets method) into a text control and transform that "To Variant".  Then, upon using the Print Preview feature of Excel, I was able to see the header and footers I had chosen.
Regards,

James R.
National Instruments
0 Kudos
Message 4 of 7
(3,366 Views)

Hi James,

Thank you for the information.  I tried what you said but it doesn't seem to work still, like before it looks like it opened the file but doesn't do anything to it.  Maybe I am doing something wrong still, can you post the modification you made?

Tom

0 Kudos
Message 5 of 7
(3,347 Views)
James,
 
I'm an idiot.  The code has been working all along.....just that I had to save the workbook.  I was just opening the workbook afterward and that is why the changes never showed up.  Everything is working fine now, thanks again for helping.
 
Tom
0 Kudos
Message 6 of 7
(3,343 Views)

Hi Tom,

 Can you share the troubleshooted code? I'm facing some issue on creating footer in excel sheet.

 

Thank in Advance,

Hari  

0 Kudos
Message 7 of 7
(439 Views)