|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Create Excel Object via vb script in a Network Folder
Hi,
I am using Vb Script in HTML to read an xml file and upload the same to Excel in a formatted manner. The problem i am encountering is in the CreateObject("Excel.Application") command. When i save the Html File and the xml file to my local drive and then open the html and click on the button to download..the Excel Application is getting opened. But if i save both the files to a folder on my network(mappped as Z: Drive)..then the CreateObject is not working. Can someone help me on this... The code is as follows: <SCRIPT LANGUAGE="VBScript"> ' Declare the Constants Const xlNormalView = 1 ...... ' Declare the work variables Dim retVal Dim FsWkTxt........ Sub Download2Excel Set xlApp = CreateObject("Excel.Application") xlApp.Visible = True xlApp.Workbooks.Add xlApp.ScreenUpdating = False DateMsg = "Generated on - " + FormatDateTime(Now(), 0) ' Load the xml file strFileName = "Stock Report.xml" Set oDoc = CreateObject("MSXML2.DOMDocument") oDoc.async = False oDoc.validateOnParse = True oDoc.Load strFileName If oDoc.parseError.errorCode = 0 Then R = 0 C = 0 For Each ANode In oDoc.childNodes 'For each ROOT If ANode.hasChildNodes Then xlApp.ActiveCell.Offset(R, C).Value = ANode.NodeTypedValue xlApp.ActiveCell.Offset(R, C).Font.Bold = True xlApp.ActiveCell.Offset(R, C).Font.Size = 11 R = R + 1 End If.... Next End If.... ......... ........ End Sub Thanks in Advance, Prajeesh Krishnan |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Create Excel Object via vb script in a Network Folder |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|