How to save the worksheet active instead of workbook

The excel file has 3 different sheets.  I changed the data on the worksheet 3 but cannot save it in format MS DOS.  She saved the spreadsheet 1 instead.  How can I save the data on the worksheet 3? Here is the code example.  I am running windows XP SP3 latest and CVI 2010.

#include "excelreport.h".

int main (int argc, char * argv [])
{
HRESULT second;
char szErrMsg [256];
CAObjHandle HdlWorkbook;
CAObjHandle HdlXLApp;
CAObjHandle HdlWorksheet;
double data [2] = {200,2354.25898};
value of double type = 7777.9;

If (InitCVIRTE (0, argv, 0) == 0)
Returns - 1; / * memory * /.

Open Excel and make it visible
Second = ExcelRpt_ApplicationNew (VTRUE & HdlXLApp);
If (second) goto ExcelRpt_Err;

Open the Excel file
Second = ExcelRpt_WorkbookOpen (HdlXLApp, "Template.xls", & HdlWorkbook);
If (second) goto ExcelRpt_Err;

Second = ExcelRpt_GetWorksheetFromName (HdlWorkbook, "Test_Cases", & HdlWorksheet);
If (second) goto ExcelRpt_Err;

put a breakpoint here
Second = ExcelRpt_WriteData (HdlWorksheet, "D88", ExRConst_dataDouble, 1, 1, &value);)
If (second) goto ExcelRpt_Err;

put a breakpoint here
value = value + 1111.1;
Second = ExcelRpt_WriteData (HdlWorksheet, "D99 ', ExRConst_dataDouble, 1, 1, &value);" ")
If (second) goto ExcelRpt_Err;

Save the workbook
Second = ExcelRpt_WorkbookSave (HdlWorkbook, "test3.txt", ExRConst_TextMSDOS);
If (second) goto ExcelRpt_Err;

close the workbook
Second = ExcelRpt_WorkbookClose (HdlWorkbook, 0);
If (second) goto ExcelRpt_Err;

Quit the Application
Second = ExcelRpt_ApplicationQuit (HdlXLApp);
If (second) goto ExcelRpt_Err;

order of memory space

CA_DiscardObjHandle (HdlWorksheet);
CA_DiscardObjHandle (HdlWorkbook);
CA_DiscardObjHandle (HdlXLApp);

ExcelRpt_Err:
Memset (szErrMsg, 0, sizeof (szErrMsg));
CA_GetAutomationErrorString (second, szErrMsg, sizeof (szErrMsg));
MessagePopup ("Excel report error", szErrMsg);
return 0;
}

Edit:

You cannot save a single worksheet in Excel. At least not in Excel 2007 I.

Just try to do it manually and see what that who gets you.

If you mean, you want to save a file *.xls in *.txt format, you must do a SaveAs.

Tags: NI Software

Similar Questions

  • How to make 'Save to Desktop' save the default value instead of 'This PC'?

    How to make 'Save to Desktop' save the default value instead of 'This PC'?

    Windows 10, I guess?

  • I am new to adobe.  Saved gall .pdf for Adobe PANEUSE Xi and can be seen on the screen.  How to save the .pdf on my Flash drive file: L?

    I am new to Adobe.  Have the .pdf file in Adobe Reader Xi and can open and see on my screen.  How to save the .pdf on my Flash Drive file: L?

    I would advise against ever record directly onto a flash drive. For no reason I can understand this often broken leaves files behind.

    Instead, just save it to your desktop and drag it to the usual flash drive (in Windows Explorer or the Finder).

  • Re: How to save the video file to a DVD-R for Equium A200

    I have the Equium A200. Someone can tell me how to save the video file to a DVD-R on my computer in order to use it later, or use it in windows movie maker and must not simply copy on another DVD-R right?

    My cursor also has disappered in the suite of windows media, that makes life quite difficult.

    Any ideas?

    Thank you.

    You mean, you want to copy the original DVD movie to HARD drive?
    Well, you can copy the contents of the entire DVD to the HARD drive. It means that you have to copy a lot of data.
    I would recommend shrinking the DVD movies using a tool called DVD shrink.
    It would decrease the data and would also copy the content to the HARD drive.

    But if you want to use these files later in windows movie maker, so you must convert these using a 3rd party tool.
    Google a bit and you should find many free applications that would help you to do this work.

    Good bye

  • How to save the data in table 1 d to Excel in continuous

    Mr President.

    How to save the data in table 1 d to Excel at all times, so that all the data of the first scan must be placed first thought and all the data from the second analysis must be placed on the second Board and continue on the street...

    Sy@m...

    Hi Sy@m

    Here is a vi that might give you a few ideas to try:

  • Why did I lose macros when you save the worksheet

    I opened a spreadsheet with the macro code and vb and when I save it it loses the macro.  the worksheet is protected and allows changes to cells not formulas.  When I save the worksheet, he loses the functionality to make changes.  I wrote the code in vb to allow this, but who does not feature

    Hello

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums

    MSDN forums
    http://social.msdn.Microsoft.com/forums/Mr/category/VisualBasic

  • How to get the new activation key when some numbers are taken away and you have received?

    How to get the new activation key when some numbers are taken away and you have received?

    Have a laptop with windows 7 from Dell. Need to re install W7. And I have some numbers are taken as a result of its use.
    How can I get a new code activation or my complete activation code?
    Best regards, W7 user

    How to get the new activation key when some numbers are taken away and you have received?


    Have a laptop with windows 7 from Dell. Need to re install W7. And I have some numbers are taken as a result of its use.
    How can I get a new code activation or my complete activation code?

    Dell provided you with restore/recovery media and/or a way to restore the machine 'default' as a key sequence?  If so - you won't need the number--unless they just sent a DVD of Windows 7 nu - and they are usually not unless you ask.

    They have probably installed using their key, which means that even with a utility like Belarc Advisor or ProduKey - you will not get the product key that matches the one on the sticker.

    Some may have you take several different digital pictures of the sticker from different angles and see if you can decipher the missing characters like that (you'd be surprised to see how that works).

  • How to save the. File of ATN in Photoshop CS5 screen area

    How to save the. File of ATN in Photoshop CS5 screen area

    Hello

    Greetings!

    Open Photoshop.

    Open the Actions panel and select the action that you want to save to the desktop.

    Click the option panel (arrow pointing down with 4 rectangles)

    Choose Save Actions from the menu and choose the place like office and save.it

    Concerning

    Jitendra

  • How to save the .ico format

    How to save the .ico format

    You need plug-ins specific / programs such as Axialis Icon Workshop.

    Mylenium

  • How to save the document in integers and not page by page

    How to save the entire document and page by page?

    Hi francoisc2113463,

    If you want to save individual pages of a PDF file, you must use Acrobat (in the Pages pane in the tools Panel, you can use the Extract command). If you do not have Acrobat, feel free to give it a try. You can download a 30 day trial of http://www.adobe.com/products/acrobat.html.

    Best,

    Sara

  • My Photosmart HP 7520 now trys to save the PDF file instead of print it when I try to print it - it printed previously.

    My Photosmart HP 7520 now trys to save the PDF file instead of print it when I try to print it - it printed previously. What should I do to get it to print rather than life-saving?

    Clear the PRINT TO FILE option in Acrobat or Adobe Reader. It will be somewhere in the print dialog boxes.

  • I created an animated banner 468 x 60 in edge animate. How to save the image hosted on my desk? (not in HTML)

    I created an animated banner 468 x 60 in edge animate. How to save the image hosted on my desk? (not in HTML)

    Hello

    This feature is not available in Adobe Edge animate. You cannot export as image of the animate edge.

    Publish here describe the options available on board

    M lively help | Publish your content

    Kind regards

    Devendra

  • How to save the slide show settings so when I press on Ctrl + enter only what I want?

    How to save the slide show settings so when I press on Ctrl + enter only what I want?

    huh?

    R

    I tested what you gave me there Rob. On my Mac, I have two monitors:

    -Blacken / display slide show on a monitor (the primary monitor, if I move LR in my secondary follow-up, the slide show is still on the first, but the second still works normal with LR just sitting there).

    -If I turn off slide durration I manually advance the slides with the right arrow.

    -I don't have 'Lightroom' (or with my settings current all) text on the screen.

    -Does not repeat itself.

    My Windows machine is not two monitors, but the others work properly...

    In other words, until I thought about it differently. As we seek to change the slideshow settings, I was naturally in the slideshow module. But I then remembered that the interest of the Impromtu Slideshow is that you can view the slide show playback from any module. Once I went back to the library and click Command / Ctrl + Enter, then I saw exactly what you're talking about. Both monitors are blackened, duration of the slide is ignored, etc.

    You know why? As the Impromptu slideshow uses one of the models outside the slideshow Module. Which one? Well, by default +, of course. How do change you that? Right-click (Cmde) slideshow model you prefer to use and select «Use for Impromptu slide show»

  • How to save the custom of the user using PHP field?

    Hello!

    I am looking for a way to share specific data to the user between connected users. For example, all participants must know each other IDs (our own system IDs, no ACC).

    Custom user fields seems the best solution for this, but I can't find a way to save one using PHP, while creating the room.

    How to save the custom of the user using PHP field? Or maybe there's best solution to do such things?

    Had, just add the new node to the UserManager collection.

    const USER_MANAGER_COLLECTION = 'UserManager';
    static private $USER_MANAGER_CUSTOM_FIELD_CONFIGURATION = array(
       'accessModel'=>self::ROLE_VIEWER,
       'publishModel'=>self::ROLE_VIEWER,
       'persistItems'=>true,
       'modifyAnyItem'=>false,
       'userDependentItems'=>true,
       'sessionDependentItems'=>false,
       'itemStorageScheme'=>self::STORAGE_SCHEME_MANUAL,
       'allowPrivateMessages'=>true,
       'lazySubscription'=>false,
       'p2pDataMessaging'=>false
     );
     const USER_INVITE_ID_CUSTOM_FIELD = 'inviteId';
     static private function createUserManagerCustomFields($room){
       $account = self::init();
       $collection = self::USER_MANAGER_COLLECTION;
       $account->subscribeCollection($room, $collection);
       $account->createNode($room, $collection, self::USER_INVITE_ID_CUSTOM_FIELD, self::$USER_MANAGER_CUSTOM_FIELD_CONFIGURATION);
     }
    
  • How to save the .txt file without opening a dialog box.

    Hello..

    How to save the .txt file without opening a dialog box.

    It is impossible to Flash running in the browser.

Maybe you are looking for

  • Re: Satellite C660D - 10 d - problems with updates of drivers

    Greetings from Greece We bought a toshiba Satellite C660D - 10 d. It came with windows7 64-bit.After the windows installation and updates of windows updates, that I entered toshiba for updating readers, some of them was not installed. Then, the inter

  • Re: Satellite Pro L500-1VX-accessibility (FN key) does not work correctly

    I need your help to fix this problem on my Accessibility button does not work, when I press the FN key to turn my wireless on it does not work.When I go to program files > Toshiba > utilities > TACSPROP.exe a warning alert telling me it does not allo

  • How to count the pulses with digital input on 6351

    Hi all experts in Labview,. I just got my USB x series 6351 and it works fine, but I certainly lack of labview skills to use it to its full potential. I would like to read digital pulses with several digital inputs and count the number of pulses each

  • KB 967723 error 80073712

    I tried for days installing the update, but it never installs and windows reports an unknown error. Any ideas? I am running vista Home premium. I tried to solve the problem with cmd.exe, but he has no problem with any.

  • Hama black force gamepad is not recognized by windows 7

    Hi all. I recently bought hama black force gamepad a d there is no way I can make it work on windows 7. I install the drivers and then connect the game controller to the computer. It seems to recognize him, but the analog/led button is not not work/f