From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-03-2013 04:56 PM
You should use these settings to save your file:
Excel_WorkbookSaveAs (ExcelWorkbookHandle, NULL, file_name_Variant,
CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_VariantBool(VFALSE),
CA_DEFAULT_VAL, ExcelConst_xlNoChange,
CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL);
01-04-2013 04:39 AM
Hi;
Kindly, can you give me help or each parameter of those two functions;
Excel_WorkbooksOpen
Excel_WorkbookSaveAs
Every time when i want to change any parameter, i don't what to put in each one, and i don't any information in the "help";
Many thaknss 🙂
01-04-2013 12:39 PM
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
01-04-2013 02:53 PM
Informations on SaveAs can be found here: CVI exposes an interface to this function into his instrument. On Microsoft site you can find informations on all other functions you may be using.
01-06-2013 04:11 PM
hi,
pls, i can't finish that project ohhh my GOD!
i succeed to do all, but when i open existing workbok, the system open it for read only, and i passed (file not for read olny) in parametres!!
honestly don"t understand why;;
need to re open existing file and write datas into it and close it with datas qlready written;
Help pls;
01-07-2013 02:24 AM
Hello touha,
some questions on your last problem:
If all your attempts were unsuccessful, can you post the code you use to open the file?
01-07-2013 03:46 AM
Good morning dear Roberto;
So, for the part of "writing data into excel file":
Every second, i've to read data from RS232 port, then write it into an excel file;
A new excel file have to be created every day, means the frist time i launch application, the xl file will be created, and then while the application is unning, every data readed have to be written into that file and when i quit the application, the file have to be saved;
I already used the method founded on excel sample on CVI, but it doesn't work ;
Every time, when i run application, i see the file opened, i see th e data writen into it and all is weell, but when i want to quit the application, it shows me a window that ask me to save the file as a copy of the file, and on the top of the xl file, it's for "read only";
Note, that when i close all without saving, i found the file created, but it's empty;
I tried to delete it, for example, i can't, a window tell me that it 's used by my computer, the processus "xl" is used by another one....
Really need help ASAP, 🙂
01-07-2013 05:00 AM - edited 01-07-2013 05:08 AM
How you "see" data written into the file? Are you opening the file in Excel at the same time you are writing to it with CVI? What happens if you don't do it?
When working with ActiveX it is crucial that all resources are correclty disposed of when they are no longer needed. In order to check this detail follow this procedure:
By the way, "every second" means 86400 recordings per day: supposing you are using one row per recording you need to use a recent version of Excel. At least up to Excel 2003 you are limited to 65536 rows.
01-07-2013 01:40 PM - edited 01-07-2013 01:42 PM
I run the example excel2000dem.prj and there's nothing wrong with saving the file.
The only things that I changed are:
1) Remove the "Read-Only" setting of the "exceldem.xls" so that it can be modified.
2) Use the function below that associated with the "Close File" button in the UIR.
Excel_WorkbookClose (ExcelWorkbookHandle, NULL, CA_VariantBool(VTRUE),
CA_DEFAULT_VAL, CA_VariantBool (VFALSE));
That's it. You don't even need the SaveAs function. The modified excel file will be saved and closed automatically.
01-08-2013 03:27 AM
Good morningg;
MAny many thanks for dcl91000 and Roberto
So, i succeed to do it well, and it works 😉
Now, i've another issue, i've to display max & min into the xl file, of the whole 24 hours, means every time when i quit the application, i've to keep the values of max & min into memory, to use them again when i run the application another time;
Actually, i used files to save every value into it, and when i run the application agoing i read that value and use it in my prog=> But like that i've many many files 😞 it becomes very hard to manage...
I tried t save them into one file means write from array to file and then read from file to array, but that doesn't work wel, look like the value is not updated into the file when i write from array to file...
Have you any comments 🙂