How do I save an excel file as XML using applescript.

I set display alerts to false, but excel will not save.  I get error -1708.
My code looks as such:
set theFile to "Macintosh HD:Users:Dustin:Documents:products.xlsx"
tell application "Microsoft Excel"
  activate
  open theFile
          set display alerts to false
          tell active sheet
  save as filename "products.xml" file format XML spreadsheet file format
          end tell
  close active workbook without saving
          set display alerts to true
end tell
end
If I remove the code to set the display alerts, excel pops up an display alert to continue or cancel the save.
I'll take anything at this point....

Are you sure you want to do a "SAVEAS" to create the PDF?  What version of MS Office are you using?
One of the best ways to figure out how to do something with ActiveX in Excel is to first do it in Excel by recording a Macro.  See what code Excel generates, then try to model that in LabVIEW.
I don't see .pdf as an option you can save Excel as a filetype to (Excel 2007).  But when I go to the Excel 2007 button, Save As, then PDF or XPS while recording a macro, I get this code.
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Documents and Settings\CurrentUser\Desktop\FILENAME.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
   This shows me you should be usingthe ExportAsFixedFormat method on the worksheet as opposed to trying to use the SaveAs method on the workbook.  (But the workbook object as that same method as well.)

Similar Messages

  • How do I save a excel file to be compatible...

    How do I save a excel file from a pc to be compatible with my Mac?

    Hi juicebars,
    iWork is a productivity suite for Macs running OS or iThings running iOS. With a MacBook Pro you will need the OS version.
    iWork consists of:
    Pages, a word processor and page layout app (page layout mimics a drawing app). Pages can import Microsoft Word documents and you can edit and save them. Also Export as MS Word, PDF, plain text, RTF or ePub.
    Numbers, a spreadsheet app that mimics a database. Numbers can import Microsoft Excel or CSV documents and you can edit and save them. Also Export as MS Excel, CSV or PDF.
    Keynote, a presentation app. Keynote can open Microsoft Powerpoint. I don't use Keynote, so I can say no more.
    You can buy the iWork suite from the App Store, or buy Pages, Numbers and Keynote separately.
    There are some minor conversion glitches when converting between MS Office and iWork. If you are continually converting, it is best to buy Office or LibreOffice for Mac.
    iWork does not take kindly to huge documents.
    However, I find that Numbers and Pages for Mac OS to have a sweetly intuitive way of doing what I want.
    Regards,
    Ian.

  • Convert MS Excel File to XML using ssis

    Dear Experts,
    i want convert Excel file to XML(based on .XSD) using SSIS-2012.
    so request you to provide steps how to build this job.
    Thanks in Advance.
    Anil.

    Have Data Flow1 - Export Excel data to SQL Table
    Have Data Flow2 -
    Export SQL Table to XML by using FOR XML clause in your SELECT statement.
    FOR XML clauses has several options such as RAW/AUTO or specify the ROOT and then you get the XML the way you want.
    Another option is to use 3rd party Cozyroc -
    Template Task
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • How can I convert an Excel file to XML file

    The problem is I am given an Excel file and have been asked to convert it to an XML file using Java.Can any body highlight any clue regarding this? My thanks in advance.

    Gotta use your own imagination.
    I'd have a root tag <excel-spreadsheet>. Under that I'd have a <worksheet> tag for each worksheet. Under that I'd have a <row> tag for each row. Each <row> tag would have <column> tags, with "name" attribute, and the spreadsheet entry as the value.
    The problem is that you can't really map everything that will go into a spreadsheet into this stream (e.g., graphs, stray cells, etc.) It maps well to tables, but that's it.

  • How to save an Excel file to the desk top

    How can I save an Excel file to the desk top?

    Hi Tim!
    There's a whole bunch of entries that come up when I open terminal and key in the command you gave; here's what is shown:
    Davids-Mac-Pro:Desktop pdf3$ ls -ale ~
    total 38384
    drwxrwxrwx+  41 pdf3  admin      1394 Nov  2 09:12 .
    0: group:everyone deny delete
    drwxr-xr-x    6 root  admin       204 Sep 19 14:58 ..
    -rw-rw-rw-    1 pdf3  admin         3 Jan 24  2012 .CFUserTextEncoding
    -rw-rw-rw-@   1 pdf3  admin     39940 Nov  3 10:48 .DS_Store
    drwx------    2 pdf3  admin        68 Nov  6 09:02 .Trash
    drwxrwxrwx    3 pdf3  admin       102 Feb  1  2012 .adobe
    -rw-rw-rw-    1 pdf3  admin       302 Nov  6 09:20 .bash_history
    drwxrwxrwx    6 pdf3  admin       204 Dec 31  2013 .blurb
    drwxrwxrwx    3 pdf3  admin       102 Oct 21  2012 .config
    drwxrwxrwx    3 pdf3  admin       102 Jan 27  2012 .cups
    drwx------    7 pdf3  admin       238 Jul 26 20:36 .dropbox
    drwxr-xr-x    4 pdf3  admin       136 Dec  7  2013 .fontconfig
    drwxrwxrwx    3 pdf3  admin       102 Mar 17  2012 .nchsoftware
    -rw-rw-rw-@   1 pdf3  admin        17 Oct 21  2012 .vbftpxmn
    -rw-r--r--@   1 pdf3  admin   1315548 Sep  3  2013 2014 Bellevue SW Collection Contract 04 15 2013 draft for RFP.pdf
    drwxrwxrwx    2 pdf3  admin        68 Sep 21 11:04 Applications
    -rw-r--r--@   1 pdf3  admin    326665 Aug 30  2013 Bellevue Reliability Report 2012 042613 Final-1.pdf
    -rw-r--r--    1 pdf3  admin      6737 Sep 25  2013 Bellevue Reliability Report 2012 042613 Final.txt
    -rw-r--r--@   1 pdf3  admin     35892 Oct 30 22:15 Bellevue Utility Bills, 2015-16.xlsx
    drwxrwxrwx@   3 pdf3  admin       102 Aug 16 14:52 Burn Folder.fpbf
    -rw-rw-rw-@   1 pdf3  admin     25989 Jun 18  2012 Concerns Expressed to City of Bellevue Regarding Approval of.pdf
    -rw-r--r--@   1 pdf3  admin    165592 Sep  5  2013 David's Autobiography copy.pdf
    -rw-r--r--@   1 pdf3  staff     34836 Jul 26 21:21 Deck Repair, 2014.xlsx
    drwx---rwx@  35 pdf3  staff      1190 Nov  5 12:54 Desktop
    0: group:admin allow list,add_file,search,add_subdirectory,readattr,writeattr,readextattr,writeextat tr,readsecurity
    -rw-r--r--@   1 pdf3  admin    111548 Nov 15  2013 Document2.pdf
    drwx------+  18 pdf3  staff       612 Nov  5 11:43 Documents
    0: group:everyone deny delete
    drwx------+ 494 pdf3  staff     16796 Nov  2 22:09 Downloads
    0: group:everyone deny delete
    drwxr-xr-x    2 pdf3  admin        68 Nov  1 11:54 Excel Work Book
    drwxr-xr-x    2 pdf3  admin        68 Oct 31 20:42 Excel Workbooks
    -rw-rw-rw-@   1 pdf3  admin  16862554 May 29  2012 Group Shot.psd
    drwx------@  53 pdf3  staff      1802 Sep 19 15:17 Library
    0: group:everyone deny delete
    drwx------+   6 pdf3  staff       204 May 28  2013 Movies
    0: group:everyone deny delete
    drwx------+   8 pdf3  staff       272 Feb 24  2014 Music
    0: group:everyone deny delete
    -rw-rw-rw-@   1 pdf3  admin    117444 Jul 21  2008 P6M-2 In Close copy.jpg
    -rw-r--r--@   1 pdf3  admin     46473 Aug 16 14:50 PW-M-1 Overlay Budget.xlsx
    drwx------+  65 pdf3  staff      2210 Nov  5 11:43 Pictures
    0: group:everyone deny delete
    drwxr-xr-x+   5 pdf3  staff       170 Jan 24  2012 Public
    0: group:everyone deny delete
    drwxr-xr-x    6 pdf3  admin       204 Mar 10  2014 Sound Transit Bel-Red Cost Estimate
    drwxr-xr-x   34 pdf3  admin      1156 Sep 21 09:24 WW II Songs & Opera #1
    -rw-r--r--@   1 pdf3  admin    172859 Feb 25  2014 photo 1.JPG
    -rw-r--r--@   1 pdf3  admin    172859 Feb 25  2014 photo 3.JPG
    Davids-Mac-Pro:Desktop pdf3$
    I have no idea what all this stuff means, but I've done a 'disk verify' for both my drives, and the results indicated they were both 'OK'.Dave P.

  • How to create an Excel file from XML in the Receiver File Adapter Comm Ch

    How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
    I saw this blog, but I don't know how to create a XSLT transformation.
    /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
    Any help would be appreciated. Thanks.

    Here are the steps I took to create an XSLT transformation in XI 3.0:
    1. I created my source and target XSDs using XMLSpy.
    2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
    3. I created another XSLT mapping to format the target into Excel XML.
    4. Import the source and target XSDs in the IR's External Definitions
    5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
    6. Reference the XSL mappings in the Interface Mapping

  • Modifying and saving a Excel file by the use of Blob-Stream Method?

    Hi everyone...
    I'm trying to change and modify a Excel file which is received as Blob variable from database.
    I wrote a PL/SQL Procedure which get the Excel file and convert it to blob; after that send it as the parameter of a Java source called TestPrintExcel
    CREATE OR REPLACE DIRECTORY VMI_TEST_DIR AS '/afc/opt/dba/test_utl_dir';
    GRANT READ, WRITE ON DIRECTORY SYS.VMI_TEST_DIR TO SYSTEM;
    declare 
       bfi  bfile := bfilename('VMI_TEST_DIR','TestFzglist.xls');
       bin  blob;
       cout clob;  
    begin
       dbms_lob.open(bfi);
       dbms_lob.createtemporary(bin, true);
       dbms_lob.loadfromfile(bin, bfi, dbms_lob.getlength(bfi));
       dbms_lob.close(bfi);
       dbms_lob.createtemporary(cout, true);
       dbms_java.set_output(100000);
       TestPrintExcel(bin);
       dbms_output.put_line('done!');
    end;With the following Java procedure I can read the content of the Excel file and write it to database perfectly. But the question is, how can i save the excel file with the same way, if i would change or insert any cell? I mean with the same way that to save as blob stream. Because i get permission error when i use another methods like FileOutputStream, FileInputStream etc. That's way i want to resolve this problem with the blob-stream method. Can anybody tell me how i can do that or what a method i have to use?
    Thanks.
    create or replace and compile java source named xltest as
      import org.apache.poi.ss.usermodel.WorkbookFactory;
      import org.apache.poi.ss.usermodel.Workbook;
      import org.apache.poi.ss.usermodel.Sheet;
      import org.apache.poi.ss.usermodel.Row;
      import org.apache.poi.ss.usermodel.Cell;
      import org.apache.poi.ss.util.CellReference;
      import org.apache.poi.ss.usermodel.DataFormatter;
      import org.apache.poi.ss.usermodel.FormulaEvaluator;
      import java.util.*;
      import java.sql.*;
      import oracle.sql.*;
      import oracle.jdbc.driver.*;
      public class XLTEST {
        public static void printx( oracle.sql.BLOB xblin ) throws SQLException {                       
          Connection Conn = null;
          try {
            Conn = DriverManager.getConnection( "jdbc:default:connection:" );
            Workbook wb = WorkbookFactory.create( xblin.getBinaryStream() ); // "/afc/opt/dba/test_utl_dir/TstFzglist.xls"
            for ( int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++ ) {  //NumberOfSheets
              String TableName = new String();       
              switch( sheetNum )
                case 0:
                  TableName = "freeimportxls_s1"; break;           
                case 1:
                  TableName = "FreeImportXLS_S2"; break;
                case 2:
                  TableName = "FreeImportXLS_S3"; break;
                default:
                  break;                  
              Sheet sheet1 = wb.getSheetAt(sheetNum);         
              java.util.Iterator<Row> ri = sheet1.rowIterator();                 
              while ( ri.hasNext() ) {
                Row row = ri.next();
                java.util.Iterator<Cell> ci = row.cellIterator();                       
                while ( ci.hasNext() ) {
                  Cell cell = ci.next();
                  CellReference cellRef = new CellReference( row.getRowNum(), cell.getColumnIndex() );                         
                  switch( cell.getCellType() ) {
                  case Cell.CELL_TYPE_STRING:                            
                    Values   += "'" + cell.getRichStringCellValue().getString() + "'";               
                    break;
                  case Cell.CELL_TYPE_NUMERIC:
                    Values   += "'" + cell.getNumericCellValue() + "'";
                    break;
                  case Cell.CELL_TYPE_BOOLEAN:
                    Values   += "'" + cell.getBooleanCellValue() + "'";
                    break;
                  case Cell.CELL_TYPE_FORMULA:
                    Values   += "'" + cell.getCellFormula() + "'";
                    break;
                  default:
                    Values   += "''";               
                  int Counter1 = cell.getColumnIndex() + 1;
                  int Counter2 = row.getLastCellNum();
                  if ( Counter1==Counter2 ) {
                    Values   += ")";                          
                  else {
                    Values   += "," ;
                } System.out.println ( Values );               
                if ( ( sheetNum >= 0 ) && ( sheetNum <=2 ) ) {
                   String sqlUpdate = "INSERT INTO " + TableName + " VALUES " + Values;
                   PreparedStatement pstmt = Conn.prepareStatement( sqlUpdate );                                          
                   pstmt.executeUpdate();           
                   pstmt.close();              
            } Conn.close();
          } catch ( java.sql.SQLException e ) {       
            System.err.println( e.getMessage() );
            e.printStackTrace( System.err );
            Conn.close();}        
      };

    Hi,
    Because i get permission error when i use another methods like FileOutputStream, FileInputStream etc.Permission errors are generally resolved by granting the proper privilege via DBMS_JAVA.grant_permission procedure.
    Have you already tried that?
    http://download.oracle.com/docs/cd/E11882_01/java.112/e10588/chten.htm#BABHDBCJ

  • How to save an excel file as CSV with semi-colon as data separator?

    We are creating a flat data file to load the flat file data to our BW system with Excel.  When we save the file, there are three kinds of CSV types for selecting from the "Save as type" list box:
    CSV (Comma delimited)
    CSV (Macintosh)
    CSV (MS-DOS)
    There is no CSV (semi colon delimited) type.  If we pick CSV (Comma delimted) as the type, then when clicking the "Preview ..." picture icon under the "DataSource/Trans. Structure" tab of the InfoSource for this flat file (with the CSV radio button checked the Data separator default is ";"), the File Upload Preview window shows the data is messed up that some columns of the excel flat file are combined into one column.
    Since the save type we picked is "CSV (Comma delimited)", then we try to change the default Data separator from ";" to "," in the preview selection screen, but still not helpful!
    How to resolve the above problem?
    Thanks

    Hi Kevin,
    This "," is defined in your windows setting. If you want to have ";" as separator then go to control Panel, select Regional Options, go to Numbers Tab and define the List separator as ";". After that when you will save your excel file as CSV(MS-DOS) it will have ";" as separator. This will make sure that the amounts are not broken in to two different fields while loading.
    Else if you keep "," as separator then you can also go into the Excel and define all number fields as Number without thousand separator.
    Let me know if you have any doubts in this.
    Regards,
    Rohit

  • How do I share an excel file on my macbook pro in iCloud?

    I am using Microsoft Excel for the MAC 2011.
    I'm trying to share this file in iCloud so I can view and edit it from my iPad 2.
    I have turned on iCloud on both devices but can't figure out how to share the file.
    Any suggestions?

    You need to have Numbers on your iPad (and probably also on your Mac, not sure).
    Save the Excel file anywhere on the Mac.
    Open Safari and go to www.icloud.com and enter your AppleID and password. Click on iWork and then on the top of the window select Numbers. On the top right corner there is a weel which clicked will let you upload your excel file to iCloud.  Done.
    You will find the excle file on the iPad and open it with Numbers.
    THe compatibility is good but not 100% especcialy if the file is complex.
    PS: Numbers for iPad and for Mac are different programs, if both are needed you have to buy both.

  • No column heading in second page in alv report when save in excel file

    Hi Expert,
    How can i remove the column header from Alv report when program execute in background and save in excel file right now
    its comming column header in each page. Client dont want header column in excel from second page. is this possible?
    with regards
    chandan_viji

    Hi Ravi,
    thanks for reply i have solved this problm throug line count and NEW-PAGE LINE COUNT 10000 bcoz client want output in excel file only one page header.
    with regards
    chandan_viji

  • PeopleCode to "Save As" - convert an excel file to XML file

    All,
    Is there any way to convert an excel file to XML file via PeopleCode? I can manually "Save As" an excel file to be an XML file, but is there anyway of doing it via PeopleCode? I guess it would be a little possible via VBScript, but since by App server resides on a Unix box, that would not work.
    Any help would be really appreciated.
    Thanks,
    Mani

    The attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.
    I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.
    I have not actually used these, but others that have say they have worked well for them.
    Good Luck
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    excel_lv6i.zip ‏898 KB

  • How to convert excel file into xml file

    Friends
    Will you please help me out becz i am daily getting excel file from SAP which i have to translate into the xml file.
    Waiting for ur reply.
    Hitesh

    Depends on how your excel document looks like and what you wish to accomplish.
    First, save the excel file as a tab or comma separated file.
    Create a program that reads the lines of the file, and just print the cell content into the right xml tags.
    E.g.
    Street Name
    Main st 3 Wild Bill
    Main st 2 Crazy Bill
    could be translated into an xml:
    <Adress>
    <Street>Main st 3</Street>
    <Name>Wild Bill</Name>
    </Adress>
    <Adress>
    <Street>Main st 2</Street>
    <Name>Crazy Bill</Name>
    </Adress>
    or:
    <header>
    <col>Street</col>
    <col>Name</col>
    </header>
    <row>
    <col>Main st 3</col>
    <col>Wild Bill</col>
    </row>
    <row>
    <col>Main st 2</col>
    <col>Crazy Bill</col>
    </row>
    etc
    E.g. using the code
    String[] lineColumns=...
    while(lineColumns!=null){
      println("<row>");
      for(int i=0; i<lineColumns.length; i++){
        println("<col>"+lineColumns[i]+"</col>");
      println("</row>");
      ...Gil

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • How can i display a excel file generated by labview?

    hello,
    I'm looking for an exemple to display (open) a .xls file generated by labview after simulation but without use  the tookit report generation.
    somebody knows how could I do this?
    Any suggestions?
    Thanks,
    longar
    p.s: i use labview 8.6 
    Solved!
    Go to Solution.

    There is quite large dedicated Excel thread with a lot of examples.
    I'm curious though. If you don't have the toolkit, how did you create the Excel file in the first place?

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

Maybe you are looking for

  • Access a component in an mxml file from a different mxml file

    Hi, I want to access a component in an mxml file 1 such as this one  <mx:Image id="img" width="101" height="200" source="{product.image}"/> using the id from the actionscript function from a different mxml file 2 public function init():void        HE

  • Homescreen widgets for nokia 5230 help

    I want to know if there its any way to add homescreen widgets on nokia 5230 like that of c6 00 or n97 all these phones have the same hardware then why c6 00 and n97 has widgets but not 5230 . Please help I need that feature desperately. Thank you in

  • Validation of code

    Hello All, I am having a two quires , in which one gives the customer order total details, and another query gives the customer order total with refunds and returns. How can I validate my results? I need to verify my query is giving exact results or

  • Using Stored Procedures with TopLink / JPA : Success explanation

    For those who have to use Stored Procedures in TopLink this is my success history : To call an Stored Procedure from the persistence, we have to use the direct JDBC connection because my TopLink version ( Essentials 10g ) ? to date ( 10g ) does not h

  • Bridge cc duplicate photos when downloading from camera

    When downloading photos via bridge cc from a nikon d800e, all photos duplicate, two of each photo. Any suggestions appreciated...