Hello,
I'm using CVI Labwindows 8.0.1 with the activeX Microsoft Excel 11.0 Object Library. Unfortunately this library is not very sufficiant, so I had to add code fragments from other libraries found on different NI support pages to have e.g. SetCellRangeAttribute possibilities.
But now I'm looking for a possibility to set the page setup to DIN A4 landscape, with header and footer as also to set the zoom of the active Excel window to 60%.
As I haven't found a solution, I have create a macro in Excel. This macro should be available in all Excel workbooks, therefore I have to have written it in the Personal.xls. If I open (by hand Excel), the Personal.xls will be (hidden) opened, thus Excel knows the macro. But if I use my CVI test bench to start Excel (Excel_ActiveApp() or if not yet active Excel_NewApp()) , Personal.xls will not be opened additionally, thus the macro is not known. As different users will use my program, the location of the personal.xls file will differ too. A dilemma.
Thus some questions result:
- How can I use via activeX a page setup facility (orientation/footer/header...)
- How can I use via activeX a zoom factor for the active Excel window
- How can I start Excel from CVI, that it opens the Personal.xls (to use general macro)
- Does exist an easy way to use VBA commands in CVI to control Excel. (It seems that their is a relationship between both?)
And at last I have the problem, that CVI writes into the related Excel sheet, but I could not see the results during the measurement in the Excel sheet, as Excel doesn't move the visible range of the Excel sheet. It still shows the same rows of the sheet, even if CVI writes into cells which a far outside the scope of the visible rows. Any hint for manage that (from Excel or CVI)?
Thanks in advanced.