Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to Open XLSX, then Save as HTM

$
0
0

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



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>