![]() |
|
|
|
|
1
25th October 16:21
External User
Posts: 1
|
Hi All
In excel worksheet, Column A is web addresss Column B is output file name e.g. "c:\temp\web_ibm" Searched in Google more than one hours, can not able to found how to print to PDF File. Any suggest to using PDF object ? I want daily download some web page ,some page have graph, the html may be have graph. '~~ excel_web.vbs '~~ 2009/10/22 '~~ http://www.tech-archive.net/Archive/.../msg00232.html '~~ http://www.bytescout.com/pdfdocscout...e_vbscript.htm Option Explicit Dim objExcel Dim objWorkBook Dim oXMLHTTP Dim objAcroPDF Dim oStream DIM ExcelName Dim cnt, i Dim Address , Output, Wdate, FN ExcelName = "C:\temp\abc.xls" Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0") Set objExcel = CreateObject("Excel.Application") Set objAcroPDF = CreateObject("AcroPDF.PDF") Set objWorkbook = objExcel.Workbooks.Open (ExcelName) wDate = Year(Now) & Right("00" & Month(Now), 2) & Right("00" & Day (Now), 2) _ & "_" & right("00" & hour(now),2) & right("00" & Minute(now), 2) _ & right("00" & Second(now),2) for i = 1 to 10 Address = objExcel.Cells(i, 1).Value Output = objExcel.Cells(i, 2).Value if trim(address) <> "" and trim(Output) <> "" and left(address,1) <> "#" then FN = Output & "_" & wDate & ".html" Wscript.echo right("000" & i,3) & " " & Address & " " & FN oXMLHTTP.Open "GET", Address , False oXMLHTTP.Send If oXMLHTTP.Status = 200 Then Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream.Type = 1 oStream.Write oXMLHTTP.responseBody oStream.SaveToFile FN oStream.Close End If end if next objExcel.Workbooks(1).Save 'Save the workbook, not excel file objExcel.Workbooks(1).Close 'Close the workbook then finally quit excel objExcel.Quit set objExcel = nothing set OXMLHTTP = nothing |
|
|
|