ActiveX Excel Workbook Close won't save

I am using ActiveX with Excel and trying to save and close a workbook, but not close the application.
My question is two fold:
First, I can't get a workbook to close when save is wired up to it and set as True. But, when save is set to False, the workbook closes fine (except it doesn't save obviously). I figured this could be related to the following sentence from MSDN
If there are changes to the workbook and the workbook appears in other open windows, this argument is ignored.
To verify this is not the case, I closed completely out of Excel and tried again. Still the same issue. 
So, my next step was to try a workaround like using the saveas method, then I can close the workbook without saving after this (i.e. false constant wired up).
From MSDN: xlLocalSessionChanges = 2       The local user's changes are always accepted.
But, when I wire "2" to the conflict resolution variant for the saveas method, I still get a dialog popping up asking the user if it's ok to overwrite the file. 
Has anyone run into this before? I have pasted useful links to MSDN below.
http://msdn.microsoft.com/en-us/library/bb241584(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.close(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas(v=vs.80).aspx
CLA, LabVIEW Versions 2010-2013
Solved!
Go to Solution.

Workbook was corrupt. Solution was to recreate.
CLA, LabVIEW Versions 2010-2013

Similar Messages

  • Save report vi saves all excel workbook pages to HTML

    Hello,
    I am using the Save Report to File VI to save an Excel workbook, and then to save the open Excel file to HTML. However, it is saving all the pages of the workbook in such a way that the web browser can access all the sheets of the workbook. I only want the active sheet saved. How do I do this?

    I'm honestly not sure how to get which page is "active". I imagine there is a property you can find (either via ActiveX, Properties Nodes or some other means) which will tell you an index that is active then you can customize your report around that. Could you attach what you have now and maybe I can look for a way to do it?

  • Trying to close an excel workbook with client_ole2 leaves an excel process

    Hello ,
    I 'm trying to import data from forms (10g) to an excel workbook and i use client_ole2.
    Everything seems to work fine except the last part of my code. The excel application is closing but it leaves a process open ( Windows Task Manager).The procedure I'm using
    is the following
    PROCEDURE fill_excel
    IS
    v_ole_excel client_ole2.obj_type;
    v_ole_workbooks client_ole2.obj_type;
    v_ole_workbook client_ole2.obj_type;
    v_ole_worksheets client_ole2.obj_type;
    v_ole_worksheet client_ole2.obj_type;
    cell client_ole2.obj_type;
    v_file_name VARCHAR2 (2000) := 'C:\F101.xls';
    obj_hnd client_ole2.obj_type;
    v_ole_range client_ole2.obj_type;
    arglist client_ole2.list_type;
    v_date_from DATE;
    v_date_to_xr DATE;
    v_date_to_chr VARCHAR2(20);
    v_date_to DATE;
    BEGIN
         -- INITIALIZATION OF DATES
         GET_XRISI('GEL',v_date_from,v_date_to_xr);
         select iso_lib.Get_ISO_CONFIG_Value('DATEE')
         into v_date_to_chr
         from dual;
         v_date_to:=to_date(v_date_to_chr,'DD/MM/YYYY');
    -- OPEN EXCEL
    v_ole_excel := client_ole2.create_obj ('Excel.Application');
    client_ole2.set_property (v_ole_excel, 'visible', 0);
    -- OPEN WORKBOOKS - WORKBOOK
    v_ole_workbooks := client_ole2.get_obj_property (v_ole_excel, 'Workbooks');
    arglist := client_ole2.create_arglist;
    client_ole2.add_arg (arglist, v_file_name);
    v_ole_workbook :=client_ole2.invoke_obj (v_ole_workbooks, 'open', arglist);
    client_ole2.destroy_arglist (arglist);
    --OPEN WORKSHEETS - WORKSHEET (1)
    v_ole_worksheets := client_ole2.get_obj_property (v_ole_workbook, 'Worksheets');
    arglist := client_ole2.create_arglist;
    client_ole2.add_arg (arglist, 1);
    v_ole_worksheet :=client_ole2.get_obj_property (v_ole_worksheets, 'Item', arglist);
    client_OLE2.invoke(v_ole_worksheet,'activate');
    client_ole2.destroy_arglist (arglist);
    fill_cell (v_ole_worksheet, 'H6', value);
    -- OPEN WORKSHEET (2)
    arglist := client_ole2.create_arglist;
    client_ole2.add_arg (arglist, 2);
    v_ole_worksheet :=client_ole2.get_obj_property (v_ole_worksheets, 'Item', arglist);
    client_OLE2.invoke(v_ole_worksheet,'activate');
    client_ole2.destroy_arglist (arglist);
    FILL_CELL(v_ole_worksheet,'AY2',value);      
    -- save document as c:\F101_xxxx.xls
    arglist := client_ole2.create_arglist;
    client_ole2.add_arg (arglist, 'c:\F101_'||REPLACE(v_date_to_chr,'/' ,NULL)||'.xls');
    client_ole2.invoke (v_ole_workbook, 'SaveAs', arglist);
    client_ole2.destroy_arglist (arglist);
    -- close C:\F101.xls
    arglist := client_ole2.create_arglist;
    client_ole2.add_arg (arglist, v_file_name);
    client_ole2.invoke (v_ole_workbook, 'Close', arglist);
    client_ole2.destroy_arglist (arglist);
    -- exit Excel
    client_ole2.invoke (v_ole_excel, 'Quit');
    --To release all the memory object
    client_ole2.RELEASE_OBJ (v_ole_worksheet);
    client_ole2.RELEASE_OBJ (v_ole_workbook);
    client_ole2.RELEASE_OBJ (v_ole_workbooks);
    client_ole2.RELEASE_OBJ (v_ole_excel);
    END;
    Any suggestions will be appreciated...
    Thanks Marina

    The slowness you are experiencing is largely owing to the fact that the WebUtil package is running on the middle tier -- but the Jacob bean is running on the client. Loading a spreadsheet requires a lot of network I/O. To speed things up, implement your operation within a custom Java bean, in such a way that communication between the tiers is minimized. For example, write a Java class that receives all the data in one call, and understands how to write it to an Excel document. Deploy this class as a Java bean, and call it from your form as needed using FBEAN.INVOKE( ).
    The catch: passing data through PL/SQL imposes the 32K-character limit for VARCHAR2. If you cannot be certain that the data to be written can be expressed as a string of this size, you must consider introducing compression, passing the data over multiple calls, or possibly both.
    I've been working with this, using Java's GZIP libraries for compression, and Apache Axis' BASE64 function for binary-to-String conversion. Since I'm passing a complex data structure, I use open-source XStream to serialize this structure to XML, GZIP the XML string, Base64-encode and pass it along. Sounds awkward and cumbersome, but has worked fairly well so far.
    The XML step may not be needed for simple tabular data, but because GZIP minimizes the cost of wrapping every value in tags, the incredible convenience offered by XStream makes it worth at least trying. (One call to marshall, one call to unmarshall.)
    Sorry, but this is all I have time to write, at the moment -- hopefully it at least gives you an idea regarding the problem and possible solutions.
    Regards,
    Eric Adamson
    Lansing, Michigan

  • Error when trying to save changes to excel workbook in LabVIEW 5.1

    After making changes to an existing excel workbook I try to use the workbook invoke close and I receive error "Error 1004 occurred at Exception occured in Microsoft Excel, Close method of Workbook class failed". How can I save the changes to workbook without receiving this error.

    Be sure you close all references before closing the workbook, except workbook and application, and check where the error is born wiring the error cluster. Sometimes errors are carried from a earlier step, avoiding correct execution.
    Hope this helps

  • Not Able to Save As Microsoft Excel Workbook in Acrobat Standard X

    I keep getting the error message "Save As failed to process this document. No file was created.", when trying to Save As Spreadsheet > Microsoft Excel Workbook. What can I do to correct this error?

    I had the same problem with both Acrobat Pro CS6 and CC on a Mac OS 10.8.5. I was trying File > Save As Other > More Options > Rich Text Format. I would get the same error. I tried saving as a Word document to no avail. Web searches yielded no insight.
    Here's how I got it to work: Tools > Content Editing > Export File To... > Rch Text Format
    I think it's a bug if you can't save it under one menu but you can under another. I hope this works for you.

  • How do i save excel workbook to iphone

    How do I save an excel workbook to my iphone?

    There are two ways (numbers.ipa must be installed)
    1) USB cable needed
    - plug your phone into your computer
    - open iTunes in your computer
    - select your phone on the left
    - one you see your phone, serial number, phone number, capacity, etc on the summery tab, select tab 'apps'
    - scroll down to the bottom, left click on 'Numbers'
    - drag your spreadsheet into the box on the right
    - press sync
    2) Internet access from both device needed
    - Open Safari web browser in your computer
    - type in www.icloud.com
    - enter your Apple ID and password
    - select iWork
    - click on the 'numbers' tab
    - drag your spreadsheet into it
    - it will automactily load up on all your iOS devices.

  • Hi, OS 10.6.8  (2006 macbook pro) won't save, close projects, quit

    Hi, I recently upgraded my OS to 10.6.8 (my 2006 macbook pro - 2.16 intel core 2 duo - won't run anything beyond that), and now Logic will not close projects or save, and it won't quit until forced to!
    If anyone has any advice I'd be very grateful.
    Thanks

    You need this fix!
    http://support.apple.com/kb/TS3968
    Follow the instructions exactly, there is also a link to get what you need to install.
    Don't delete any more than the instructions call for.

  • Activex Excel Automation: the Missing Handle

    Once upon a time there was a piece of legacy code, working well.  It would open Excel workbooks, add data, and make it look nice.
    Then one fateful day, the old code creaked and groaned, and it doesn't work the same way it used to when it was fresher and younger.
    Now when the code runs, an excel 2007 reference is not closed somewhere, causing the excel.exe process to remain open after the code has finished execution.
    With great care, I have extracted all the extraneous code from the process, so that only a few base functions remain; yet the problem persists!  For your convenience, I have flattened it all onto the same vi pane (the old code is rather modular)!  Apologies for any extraneous wire bends =)
    My questions are threefold:
    What changed that caused this code to stop working? 
    Is there a better way to find and close activex references than staring intently at the wires?
    Is there, dear reader, perhaps a blatent error in the old code?
    Attachments:
    Fun with references.png ‏59 KB

    I"ve moved all the CR's to the end of the VI.  The problem persists.  Look at the examples? Are you toying with me?
    Attachments:
    test.vi ‏16 KB

  • EXCEL WORKBOOK ON APPLICATION SERVER IN BACKGROUND

    Dear Experts,
    I have to download a file as excel workbook in background on application server.
    I have used open / close data set using  that I am able to download .CSV and Tab Delimated file(with extension as .xls) but not excel workbook.
    Regards and Thanks,
    Vikas

    Hi Vikas,
        what i understood is , u hav a excel file on presentation server (desktop)  and want to upload it to the appln server. if so do the following :
    step one :  save the excel file with all the data u wanted in it.
    step two : save as  the excel file  in tab delimited format.
    step three : save as the tab delimited file in ansi    .txt format.
    Now cg3z to upload the text file (.txt) in appln server .
    open the file as below:
    DATA: begin of itab,
               col1  type <>,
               col2  type <>,
              end of itab.
    DATA : wa_itab   like itab.
    DATA: wa(100)       TYPE c,
               xeof(1)        TYPE c.
    PARAMETERS: p_file(30) TYPE c DEFAULT 'appln server path .txt' LOWER CASE
                                             OBLIGATORY,
    OPEN DATASET  <p_file> FOR INPUT IN TEXT MODE
                           ENCODING DEFAULT.
      IF sy-subrc NE 0.
        WRITE  : ' error opening the file "
        EXIT.
      ELSE.
        DO.
          READ DATASET p_file INTO wa.
          IF sy-subrc NE 0.
            xeof = 'X'.
            EXIT.
          ENDIF.
          IF sy-subrc EQ 0.
            PERFORM split_data.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        CLOSE DATASET p_file .
    FORM split_data .
      SPLIT wa AT  cl_abap_char_utilities=>horizontal_tab
                                          INTO  wa_itab-col1  wa_itab-col2  wa_itab-col3.
      APPEND wa_itab TO gi_itab.
    ENDFORM.                    " SPLIT_DATA

  • My iPhone 4 refuses to save pictures and at some instances, delete my existing pictures. I take a picture, and then go to camera roll and look, but it doesn't show up. The same thing happens when I try to screenshot things; it won't save.

    My iPhone 4 is severely making me mad. It won't save any pictures I take. I will take the picture, then go to view it in the Camera Roll, and it just won't be there. The same thing occurs when screen shotting things on my iPhone. Some times it won't even let me delete the existing pictures I had on my phone before this all happened. I will click delelte, then it will pause, and eventually close me out of the photos app. However, when I go to settings, it says I have 440MB of pictures on here somewhere. But I can oly see 3 pictures in the camera roll. Also, it says in the camera roll app that it is 'Restoring...' then just sits and loads and won't restore anything at all. HELP ME PLEASE. I have iOS 7.1 currently installed.

    Have you Tried Clearing the The Cache in the Camera or Gallery in your Applications Area.. Go to Settings--> Applications--> Manage Applications--> Select All--> Clear the Cache in Both the Camera & Gallery Clearing the Data however might Clear you Pictures in your Gallery but if your Ok with it Give it a Shot,

  • Error 97 when opening existing Excel workbook

    I have a LabVIEW application that reads environmental data from two transmitters and writes the data to two sheets of an Excel workbook (this is done using ActiveX).  I have run the application successfully on my computer and a laptop, both of which are running Windows XP and Office 2003.  After installing the application on the computer that we want to use for the actual test, however, a problem was observed.  If we attempt to open an existing Excel file (which is what we need to do), LabVIEW generates an error 97 message (null reference) and the program does not run.  This computer is running Excel 2000.  I checked the registry settings for Excel per a similar discussion and found no problems.  Opening a new Excel file works fine.  Thanks.

    Hello,
    A few things come to mind:
    1. I wonder if the excel version matters here.  Could it be that you have a different version of the activeX control on your target machine?
    2. Posting a minimal, simplified version of your code may help as well... so we can see precisely where the error occurs.  Maybe just the open operation and if relevant the ActiveX property node from which you are receiving the error - identifying precisely where the error originates will be helpful.
    3. Here is another thread addressing the same error that may be helpful to you:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=172065
    Give it a thorough read just to make sure you're not having a similar issue - if you are, you just may have the solution!
    I hope this helps!
    JLS
    Best,
    JLS
    Sixclear

  • How can I convert an entire excel workbook to pdf?

    How can I convert an entire excel workbook to pdf?  I have the box in the preferences for converting excel files marked to convert the entire workbook.  I am using Abobe Acrobat 11 Statndard.  This previously worked fine when I was using Adboe Acrobat 10 Statndard.  Now in order to convert the entire workbook I have to open the excel file, Highlight all the workbook tabs and then save the file.  Any ideas?

    In Acrobat click Edit | Preferences | Convert to PDF: select Microsoft Office Excel, then click on Edit Settings.  Make sure that 'Convert entire Excel workbook' is checked.

  • Is it possible to have two Excel workbooks open at the same time but only have one show the Document Information Panel?

    We are using SharePoint 2010 and Excel 2010. In SharePoint, we have created a custom content type that uses an Excel workbook template along with a Document Information Panel (DIP -- an InfoPath form) that always displays when a workbook of this custom
    content type is opened.  That's all working fine.  However, if one of those Workbooks is open with the DIP displayed and the user opens another Excel workbook, a DIP displays for the 2nd workbook even if it's just a regular workbook,
    i.e. not one of the custom content type.  If the user closes one of the DIPs, both close.  And if the user displays one of the DIPs again, both display. 
    Is there any way to separate out the DIP display for specific workbooks during the same Excel instance so that it shows in one but not in the other?  Or is this just something we have to live with (and train our users on)? 
    Thanks in advance.  Carol.

    Whether the DIP shows or not is a client side toggle, not something tied to an individual workbook.  So if you are using the same client instance then the DIP will display or hide based on what you did in the other workbook.  YOu might be able
    to create a macro that would display or hide it, but that's a lot of work for little advantage.  I would train the users and live with it.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Automated csv Export from a specific Tab in a Excel Workbook

    Hi,
    i would like to export a specific tab from an excel workbook on a application server in csv format - how can i do this?
    Query Extractor doesn´t - about OpenHub i am not shure.
    thx in advance!
    cu
    Dominik

    Hi,
    I think Tcode RSCRM_BAPI can help you to save in CSV format in application server from ur query.make sure you dont have any free characteristics in ur query.give it a try and lets know.If you are looking for procedure Goto TCode RSCRM_BAPI and select ur query or query view and on the toolbar select Extract and in the next screen give some tech name and select .CSV format give the file path in ur application directory and dont forget to schedule the selction.Then you would be able to see ur report in .CSv format in ur app server.
    Regards
    Chandru

  • Getting error while submitting data to excel workbook through excel services in InfoPath 2010

    Hi,
    I have a requirement where in have to fetch the calculated values from the excel workbook through InfoPath 2010 form.
    When I am submitting cell value to excel workbook using SetCellA1 by executing following action:
    "Submit using data connection: dataconnection"
    I am unable to submit form. It is giving "there has been an error while processing the form" in the front end. I checked the event viewer and it displayed following exception:
    There was a form postback error. (User: xxxx, Form Name: yyyyyyyy, IP: , Request:
    http://asadadsas Request Form Template.xsn&SaveLocation=/somelocation, Form ID: urn:schemas-microsoft-com:office:infopath:formname:-myXSD-2010-09-20T15-02-34, Type: KeyNotFoundException, Exception Message: The given key was
    not present in the dictionary.)
    I was successfully able to submit the form using InfoPath client but it is giving error in the browser.
    Is there any way or configuration that I should do to resolve this issue.
    Any suggesttion would be of great help.
    Thanks,
    Sharepoint Consultant from NY, USA

    I have exactly the same problem. The form is supposed to be submitted to the SOAP Web service (http://servername/_vti_bin/ExcelService.asmx) using the SetCellA1 operation, works fine in InfoPath Filler, but when I try to submit it in the browser, I get this
    error:
    There was a form postback error. (User: WINGTIP\Administrator, Form Name: NewEventForms, IP: , Request: http://intranet.wingtip.com/et/_layouts/FormServer.aspx?XsnLocation=http://intranet.wingtip.com/et/NewEventForms/Forms/template.xsn&SaveLocation=http://intranet.wingtip.com/et/NewEventForms&Source=http://intranet.wingtip.com/et/NewEventForms/Forms/AllItems.aspx&DefaultItemOpen=1,
    Form ID: urn:schemas-microsoft-com:office:infopath:NewEventForms:-myXSD-2011-12-29T18-18-45, Type: KeyNotFoundException, Exception Message: The given key was not present in the dictionary.)
    followed by
    Unhandled exception when rendering form on postback System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.    
     at System.ThrowHelper.ThrowKeyNotFoundException()    
     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.GetSchemaXml(String namespaceUri, Solution solution, String dataObjectName, SchemaNavigator& schema, XPathNavigator& originalSchema, XmlNamespaceManager& namespaceManager)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.IsDataSetNode(Solution solution, XPathNavigator node)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.ApplyPartFragmentGather(DataAdapter adapter, XPathNavigator sourceDOM, DataObjects dataObjects, XPathNavigator targetDOM, PartFragment[] partFragments, Boolean[]& areDataSets)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterWebServiceSubmit.Execute(Document document, Uri soapAction, Uri serviceUrl, XPathNavigator querySubDOM, XPathNavigator resultsSubDOM, XPathNavigator errorsSubDOM, Int64 timeout, DataAdapterCredentials
    credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterWebServiceSubmit.ExecuteInternal(XPathNavigator queryFields, XPathNavigator resultFields, XPathNavigator errors)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RuleAction.EvaluateExpression(Document document, XPathNavigator currentTarget)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.EvaluateExpression(Document document, XPathNavigator targetNavigator)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction()    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonSubmit.Click(Document document, XPathNavigator container)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventClick.Play(Document document, BindingServices bindingServices, EventLogProcessor eventLogProcessor)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventLogProcessor.ExecuteLog(Int32 expectedEventLogID)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.<>c__DisplayClass13.<PlayEventLog>b__11()    
     at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
    What might be wrong? Are there any InfoPath configurations that need to be done? And, do I need to save the connection to the Excel Service Service Application to a connection file?
    Thanks,
             Boris

Maybe you are looking for

  • Error in sqlplus_exec_template for executing a process workflow

    Hi, en_dev_rep_owner = owb reposittory owner owb10g2 LC_OWF = owf location PROCESSFLOW = tasktype WF_DIMS = Process flow (not the process package) This is returning the following error : SQL> connect en_dev_rep_owner/en_dev_rep_owner@en_dm_dev_test C

  • Extract data from ECC6 to Netweaver2004s for BI7.0

    Hi Guru's, I have two systems ECC 6 and Netweaver2004s.For BI7.0 in Netweaver2004s i want to Extract the data from ECC6 into Netweaver2004s BI 7.0. 1.How can i make ECC6 as a Source System for the Netweaver2004s. 2. In Netweaver2004s for BW 3.5 i am

  • After exporting finished movie project, one clip is gone but all others are visabel

    I hope someone can help me out. After importaing my movie project from iMovie into FCPX I made some changes to the project and was able to exported it. After exporting, all clips we visable with the expection of one.  How can I fix this? The original

  • How can I get adobe reader to recognize new nook device

    How can I get my adobe reader to recognize my new nook glowlight reader so I can download library books?  I already have adobe reader installed.

  • Creating Disk Image Freezes

    I'm attempting to do a full backup of my boot drive to an external hard drive using Disk Utility to create a disk image.  For some reason, it always gets to a certain point, and then locks up.  This morning when I came into the office, it was locked