Script to Open XLSX, then Save as HTM

Hello, I'm a bit new to scripting. We have a spreadsheet where we keep inventory. It is Excel 2010 (.xlsx). We also have an internal (IT) "info" web where I would like to be able to click a link to open an HTML version of the same spreadsheet.
I've already done this and it works fine. What I want to do now is create a script I can schedule to run each night that will open the XLSX, then simply save it in another location as HTM (in my inetpub folder). I have successfully done this but I've run into
a problem and I believe it has to do with the FileFormat. It saves a 1kb htm file plus it doesn't save the updated worksheets. So what I end up with when I open the saved HTM file is one line of text at the top of the page. I would appreciate it very much
is one of you scripting gurus can take a look at my script below and tell me what I am missing or correct what I have for me. Thank you in advance!!
dim ObjExcel
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open( "Y:\IT-Inventory-Master2.xlsx")
objexcel.Visible=TRUE
objExcel.DisplayAlerts=False
WScript.Sleep 3000
objExcel.Save( "C:\Inetpub\wwwroot\Inventory\IT-Inventory-Master.htm")
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit

So let's change the colr to something more interesting - How about British Racing Green?
¯\_(ツ)_/¯
The brandings can still be used to mess with colors. Here's a fun one:
Red
Purple
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing)

Similar Messages

  • Script to open eps and save to jpg

    Hi,
    I would need a script to open an eps or ai file at 100dpi, rgb, with the longest side of 500 px.
    It would save the jpg at amximum quality with the same name  +  .jpg
    then close the eps file without saving it.
    I wanted tyo create an action for this but I cant figure how to create the jpg file with it's longest side to 500 pixels.
    Jean

    When you record your action use Fit Image to resize the document. Enter 500 in both width and height, that way the longest side will be 500. Fit Image will keep the image ratio.

  • Why do I have to Open and physically Save a provided .xlsx File in order to source it and process it in SSIS?

    It sounds CRAZY...but it's true and I proved it out over many tests...
    We receive a .xlsx File from an outside vendor. If we simply move the file over to our processing Path and then try to source it and process it in SSIS, we get this error...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB Error has occurred.
    Error code: 0x80004005
    However, if we open the file and Save It and/or Save As to our processing library path, we can source the .xlsx File and process it accordingly.
    Why is this? Is it because something funky is happening under the covers when the the vendor creates and saves the .xlsx File and then when we open and save it on our network it then cleans it up?
    Is there anyway that we can get around this? I hate for the processing clerk to have to go through what seems like a meaningless task....but I cannot think of any way around this if we cannot source the original file. And a C# Edit Script using Microsoft.Interpol.Excel
    is not possible because we are not allowed to put Microsoft Office on the Server where the SSIS Package will eventually reside.
    Any thoughts...suggestions...etc...would be GREATLY appreciated.
    Thanks for your review and am very hopeful (Holding my breath) for a reply and possible solution and answer to this strangeness.
    ITBobbyP85

    First of all...THANK YOU ARTHUR!
    You're probably sick and tired of seeing my posts out here on this.
    We are running Microsoft Office 32-bit which is why I downloaded the 32-bit driver of Microsoft Access Database Engine 2010 from...
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Sooooo I think what you're saying is that it is a Microsoft Office 2010 .xlsx File but utilizing the 32-bit Microsoft Access Database Engine 2010 only allows me to source as Microsoft Excel 2007.
    Nowwww....this will run on a Server...soooo a couple of questions...
    1.) Are you saying I need to use the 64-bit Microsoft Access Database Engine 2010 in order to process this file without having to open and Save it? Can I do that if we're running Microsoft Office 32-bit? Will I be able to source this on the Server because
    we cannot install Microsoft Office 2010 on the Server where this SSIS Package will live and breathe.
    2.) How can I tell which Microsoft Access Database 2010 Engine is on the server where this will eventually reside and run? 32-bit or 64-bit?
    Welllll...maybe a 3rd question...
    3.) Is there anyway to get around this driver dependency? Can I create a script to bulkcopy it and it would simply take what's on the server.
    Now mind you...we DO NOT have Microsoft Office installed on our server where this will reside...a licensing issue...
    So maybe now this explains my struggles with this damn file(excuse my French and frustration)...and why I was using a C# Edit Script to Open and Save the File until I then deployed it to the server and the Microsoft.Office.Interop.Excel DLL was not available
    on the Server because we cannot install Microsoft Office on the Server.
    Sooooo it seems as though I'm back at square one.
    UGH!
    Any additional help you can suggest or even if we can continue this "offline" would be GREATLY GREATLY appreciated.
    Thanks!

  • When I open a pdf file in Firefox and then save, how do I set the initial directory to be closer to what I want instead of a temp directory?

    When I choose to save a pdf file directly when using Firefox, it works perfectly. However, when I choose to open a pdf instead and then save it, the save directly displayed will always be a temp directory and it would be more convenient for me to choose a directory closer to where most of my files normally go. How do I change this?

    Hi,
    I partially answered your question in another posting but I feel that you´re in the wrong forum for your problem. This is for BSP development and you talk about CRM.

  • How can I open a tdms file and replace a subset of data then save that change without re-writing the entire file again?

    Hi all,
    Is it possible to open a tdms file and make a small change an an array subset then save the file without having to save the whole dataset as a different file with a new name? That is to say, is there something similar to "Save" in MS Word rather than "Save As"... I only want to change a 1D array of four data points in a file of 7M data points.
    I am not sure if this make sense? Any help is apreciated.
    Thanks,
    Jack

    You can use either one, but for your application, I would use the synchronous.  It requires far less setup.  When you open the file, set both enable asynchronous and disable buffering to FALSE to enable you to use synchronous with arbitrary data sizes.
    Attached code is LabVIEW 2011.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    UpdateTDMS.zip ‏20 KB

  • JPEG/PSD issue--I open a jpeg and edit it (levels, crop) and then "save as" and the save as option shows there are now levels in the image and it wants to save it as a .psd file or a copy with layers.  What am I doing that has these settings appear?

    JPEG/PSD issue--I open a jpeg and edit it (levels, crop) and then "save as" and the save as option shows there are now levels in the image and it wants to save it as a .psd file or a copy with layers.  What am I doing that has these settings appear?

    16bit? Pixels extending beyond the canvas? (from a crop with delete unused pixels turn off).  Have you previously been saving PSD files?
    IME you sometimes have to tell Photoshop that the first save of a session is JPG, and it remembers from there on.  The way to 'tell' Photoshop that JPG, or PDF, or PNG etc are now your preferred format is to Ctrl (Cmd) click on that format in the Save As drop down list.  So long as the file does not have parameters that your chosen format does not support, then this should work for you.
    [EDIT]  Just noticed that you did include 'Crop' in the subject line.  Do you have 'Delete cropped pixels' checked?

  • Getting "Couldnot find Installable ISAM" error in script task in SSIS 2005 when trying to open (.xlsx files) Excel 2007-2010 files using VB script in Visual Studio 2005

    Hi Experts,
    I am trying to open .xlsx file in script task of SSIS 2005. I am using the 32-bit AccessDatabaseEngine driver with the Connection string as "Provider= Microsoft.ACE.OLEDB.12.0; Data Source=xlsx file path; Extended Properties="Excel 12.0 Xml;
    HDR=YES"" in script task.
    When we debug the VB script in Visual Studio 2005 and encounters the statement app.open() it throws the error "Couldn't find installable ISAM".
    My SQL server version is 2005 SP2 DE
    OS is Windows server 2003 EE SP2
    Could anyone please let me know what is the resolution for this error?
    Thanks and Regards,
    Adesh

    Hi Adesh,
    First, make sure the package runs in 32-bit runtime mode (set Run64BitRuntime property to False) because you are using the 32-bit ACE OLE DB Provider. If it is not the case, the issue may occur due to the corrupted drivers or registry keys. You can try to
    reinstall the 2007 Office System Driver: Data Connectivity Components as Arthur suggested.
    Regards,
    Mike Yin
    TechNet Community Support

  • Script to open SVGs in a folder and save them to one multipage PDF

    Hi.
    I'm using Illustrator for work and I love it, I never needed scripts yet.
    Now I have couple houndred svgs coming in per day,
    I would like to have a script that opens every svg one by one in the selected directory and add them to a pdf
    as pages of the same size and than save it.
    Is this possible? How many files I could put in 1 pdf this way?
    I'm using Illustrator CS5 on Win7 x64.
    Thanks in advance.
    Istvan

    I think there is a 100 file limit on artboards ( not tested ) but the size would also affect that… You can't straight place *.svg but you can make group from them would that do you?
    #target Illustrator
    function filesToArtboards() {
              // My function variables…
              var doc, fileList, i, inFolder, mm, svgFile;
              // Get the user to select a folder
              inFolder = Folder.selectDialog( 'Please choose your Folder of files to place…' );
              // Check they ain't cancelled
              if ( inFolder != null ) {
                        // Gets just the SVG files…
                        fileList = inFolder.getFiles( /\.svg$/i );
                        // Make sure it has AI files in it…
                        if ( fileList.length > 0 ) {
                                  mm = 2.83464567 // Metric MM converter…
                                  // Set the script to work with artboard rulers
                                  app.coordinateSystem =
                                  CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
                                  // Add new multi-page document
                                  doc = app.documents.add(
                                             DocumentColorSpace.RGB,
                                             width = 148.5*mm,
                                             height = 210*mm,
                                             numArtboards = fileList.length, // The number of SVG files
                                             DocumentArtboardLayout.GridByCol,
                                             artboardSpacing = 20*mm,
                                             artboardRowsOrCols = Math.round( Math.sqrt( fileList.length ) )
                                  // Loop thru the counter
                                  for ( i = 0; i < fileList.length; i++ ) {
                                            // Set the active artboard rulers based on this 
                                            doc.artboards.setActiveArtboardIndex( i );
                                            // Create group from SVG
                                            svgFile = doc.groupItems.createFromFile( fileList[i] );
                                            // Move relative to this artboards rulers
                                            // Top Left
                                            sgvFile.position = [ 0, 0 ];
    filesToArtboards();

  • My biggest 'pain' at the moment is that every time I go to change then save a Photoshop CS3 file it says 'cannot save as the file as it has been left open or is in use by another application'

    My biggest 'pain' at the moment is that every time I go to change then save a Photoshop CS3 file it says 'cannot save as the file as it has been left open or is in use by another application'

    Rule Number One - NEVER go directly uinto the iPhoto library - there are no user servicable parts in it and making any change no matter how small can corrupt your library and cause data or photo loss
    Exactly how were you trying to save a copy of your iPhoto library?
    Albumdata.xml does not contain your photos - and again NEVER make any changes to the content of the iPhoto library - no dragging - no changes - never go into the library
    We need to know exactly what you did
    And probalby the easiest solution is to load your backup from before you messed things up
    For reference after you get things working
    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • How to open a file, process it with different runnables and then save it

    Hi,
    I want to read an image file, then process it using different runnable classes and then save the output in a different image file.
    In which order should I put the threads? Each process has (of course) different execution time, so I need to know where to put the wait() or lock statement.
    Any idea?
    Thanks

    gmf wrote:
    Here is a diagram
    / One image analysis - image is a buffer\
    Main/                                                             \ save to one image
    \ Second image analysis - image is a buffer/Main calls the others, and all the images are buffers so there is no problem about how do they keep from stepping on each other's toes.
    Are those two separate buffers, both copied from the original image?

  • C# Script to open and read an Excel spreadsheet with multiple worksheets

    Can someone provide me the C# syntax and Edit Script to open an Excel spreadsheet with multiple worksheets and then using the data to create and output a .csv file? The multiple worksheets contain different data elements that I'll need to parse out and then
    store as a .csv file that will then be read to pump data into our SQL Server Database.
    Thanks for your review and am hopeful for a reply.
    PSULionRP

    I think this code originally came from Joel, who comes here quite a bit.  I'm not a C# expert, like Joe is, but I think this is pretty close to what you want.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    using Microsoft.Office.Interop.Excel;
    using System.IO;
    namespace WindowsFormsApplication2
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Main();
    public void Main()
    string filePath = "C:\\Users\\Ryan\\Desktop\\MainExcel.xlsx";
    Microsoft.Office.Interop.Excel.Application xlobj = new Microsoft.Office.Interop.Excel.Application();
    Workbook w = default(Workbook);
    Workbook w1 = default(Workbook);
    Worksheet s = default(Worksheet);
    Worksheet s1 = default(Worksheet);
    Worksheet xlsht = default(Worksheet);
    xlobj.Visible = true;
    int intItem = 1;
    DirectoryInfo dirSrc = new DirectoryInfo(@"C:\Users\Ryan\Desktop\Test_Folder\");
    foreach (FileInfo ChildFile in dirSrc.GetFiles())
    try
    // Renaming the excel sheet
    w = xlobj.Workbooks._Open(ChildFile.FullName,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    w1 = xlobj.Workbooks._Open(filePath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    //this doesn't make any sense
    //w1 = xlobj.Workbooks.Open(filePath);
    //if (intItem > 3)
    Excel.Worksheet lastSht =
    (Excel.Worksheet)w1.Worksheets[w1.Worksheets.Count];
    xlsht = (Excel.Worksheet)w1.Worksheets.Add(Type.Missing,
    lastSht,
    Type.Missing, Type.Missing);
    s = (Excel.Worksheet)w.Worksheets[1];
    s1 = (Excel.Worksheet)w1.Worksheets[intItem];
    s1.Name = ChildFile.Name;
    // it will copy and paste sheet from one to another with formula
    s.UsedRange.Copy(Type.Missing);
    Excel.Range r = s1.get_Range("A1", Type.Missing);
    r.PasteSpecial(Excel.XlPasteType.xlPasteValues,
    Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
    Type.Missing, Type.Missing);
    s1.UsedRange.Formula = s.UsedRange.Formula;
    // Renaming the excel sheet
    //w.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    catch (Exception ex)
    //w.Save();
    w1.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    intItem = intItem + 1;
    //Dts.TaskResult = ScriptResults.Success
    Do you need help getting everything into a CSV, or can you take it from here???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Some clients Can't open XLSX files in Libraries using template.dotx but can open xlsx files in libraries using template.doc

    If I create a new library using any Excel/Word template - DOC, DOTX, XLS, XLTX and then upload a XLSX document (or docx) then some of my clients experience issues opening the document.  My work around in the past has been to resave the document
    as XLS or DOC.  Interestingly Old Libraries (Libraries using template.doc) don't have a problem with xlsx or docx documents.  (This only works because most of the clients experiencing the problem only open a few documents and we only have to
    resave a few documents.  I don't know why these clients have this problem though.)
    We are now testing a new Terminal Server implementation.  One with OpenOffice instead of Microsoft Office.  We can't open xlsx files on new libraries but can on old libraries.  (docx files are not a problem though)  I found a couple of
    work arounds.  One work around is to click on the down arrow by the document name and select "Edit in Excel" which fails, but then clicking on the document name after will then prompt you to Open/save the document.  Clicking on Open
    successfully opens the document in OpenOffice.  (So rather tedious for the users but nothing has to be changed to make it work.)
    The other option is to create a template from one of the libraries that is working and then use it to create a new library and save my documents to the new library.  Then I'm prompted to Open/Save the xlsx documents in the library.  This
    option is less tedious for the user but then I have to go through and recreate any libraries using template.dotx.  Creating a new library using the standard Document Library option and selecting Word or Excel 2003 does not resolve the issue - it has to
    be created from a template created from an existing library that works in the Terminal Server implementation. 
    My boss is opting for the latter option unless I can come of with an alternative that doesn't mean additional steps for the users.  Training is an issue because most of the Terminal Server users are shop floor workers. 
    My question is, is there a patch or fix that addresses this issue or any other work arounds that would be less work? 
    Additional Info:  Our Sharepoint implementation is the Enterprise version is installed but we do not have the Excel related Features activated (and these can't be activated due to licensing).  I'm not sure if that matters or not but it is
    a different configuration from how most SharePoint installations are configured.  SP1 is installed.  I have not installed any recent CU's.  Versions I see in Patch Status screen include 14.0.6029.1 (primarily) with some additional features
    reporting 14.0.6105.5, 14.0.6107.5, 14.0.6112.5 and 14.0.6114.5.
    Nancy Forbes

    We have tried a couple of additional things.
    We uninstalled OpenOffice and are testing LibreOffice.  I also installed CMIS from the SharePoint Administrator's toolkit, added the solution, and deployed it to my sites.  The "Producer" feature is activated on the site I am testing with. 
    I created a new library and posted some docx, doc, and xlsx files to it.  All files can be opened as Read-only from the Library list.  The only way I have found that I can edit the files is to Open the Library with Explorer.   I then deactivated
    the producer feature and tested opening the SharePoint documents from Explorer and it worked the same. 
    So am I misunderstanding what the CMIS Producer feature is for?
    Nancy Forbes

  • Batch script to open multiple excel and doc files

    Hi Everyone,
    Could anybody please provide a batch script to open multiple excel and doc files at a time.
    Appreciate ur quick response.
    Regards,

    You have several scripting choices within Windows. At a basic level you've got "batch files" - which run a series of command interpreter commands, and have a file extension of .BAT or .CMD. If you just wanted to open a list of Word documents, then assuming that the path to Word is correct (something like this below) you could list these in a file with a .BAT extension and run this (e.g. double click on it):
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File1.DOC"
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File2.DOC"
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File3.DOC"
    "C:\Program Files\Microsoft Office\Office\Excel.exe" "C:\Documents and Settings\All Users\Desktop\File1.XLS"
    "C:\Program Files\Microsoft Office\Office\Excel.exe" "C:\Documents and Settings\All Users\Desktop\File2.XLS"
    Another script language is VBScript, which was the example I gave. VBScript is available on most Windows platforms and can be run from a command prompt or within Windows. If you save the text I gave you above to a file with a .VBS extension you can double-click to run it (Windows) or open a command prompt and type CSCRIPT MyVBScript.VBS (assuming that's the name of the your .VBS file).
    Other script languages are available to achieve the same thing, including Powershell, however you'd need to have Powershell available on your PC.

  • A script to open files in a directory that have certain properties

    I need a script to open all JPG files in a directory and it's subfolders that have a height greater than the width and then run a specific photoshop action for each (inlcuding a save for web within the same directory). Not sure if it's best to record that into the action as it will probably always try to save in the same directory. Probably need something similar to the batch options available in Photoshop that override this...
    Any help is much appreciated.

    I think I found what I'm looking for in ImageReady although I'm not sure how to set it to batch. I don't see the batch command in the File menu like Photoshop...

  • Script to customize button event - "Save"

    I am trying to create a "Save" button but am very new at creating JavaScript. What I want to do is add a button on a form that allows form fillers to save the form without having to go to the File Menu-Save or-Save As.
    I have selected Click in the Show list, chosen JavaScript for the Language box and Client for the Run At box. But I don't know the script to have the button open up the Save dialogue box.
    Application: LiveCycle Designer ES v 8.2 with latest upgrades
    OS: MS Windows XP v 2002 Service Pack 3
    2G RAM
    Printer: HP Photosmart 8250

    Hi Jono,
    Do you have any script for saving a PDF file that is inside a portfolio, out of the portfolio?
    app.execMenuItem("SaveAs"); saves the portfolio itself. I am looking for a script to open the individual PDF in a new (separate) window and then save that file locally.
    Thanks,
    Niall

Maybe you are looking for

  • Got New AC Card, Can I Use old one for Bluetooth

    OK, the title pretty much sums up my question.  I got this ASUS wireless adapter http://www.asus.com/us/Networking/PCEAC68/gallery/ and a new Nighthawk Netgear router.  My question isn't about configuring them, but so far I've not seen BlueTooth ment

  • Oracle patch set 10.1.0.4  or patch #3895738

    I need to apply either Oracle patch set 10.1.0.4 or patch #3895738 (on top of 10.1.0.3) for Sun Solaris as suggested by Metalink Note: 283107.1 I cannot find either one by using Metalink Patches search. Where can I find them?

  • Reset - evaluate or..

    Post Author: shedevel143 CA Forum: Formula I have a formula :  IF {Customers.PriceLevel} = 0 THEN {LineItem.PriceLevel1Amount} ELSEIF {Customers.PriceLevel} = 1 THEN {LineItem.PriceLevel2Amount} ELSEIF {Customers.PriceLevel} = 2 THEN {LineItem.PriceL

  • How to upgrade NWDI

    I want to upgrade my current NWDI server from 7.0 to EHP2. Which tool do I use? JSPM or EHPI? Thanks Jex

  • HELP!! trouble with backing up

    I have all my music in my phone on my itunes playlist but not in my library? Im trying to update my phone and it wont allow me to because it says i might lose my songs, cuz they arent in my library.. How do i get them from my iphone 4 to my library?