Click here to Skip to main content
15,887,135 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Load method with file URL file location reference Pin
Eddy Vluggen20-May-14 5:23
professionalEddy Vluggen20-May-14 5:23 
GeneralRe: Load method with file URL file location reference Pin
Member 1066669820-May-14 5:44
Member 1066669820-May-14 5:44 
QuestionListing Directory using FTPwebrequest and updating DB tables Pin
Sachin k Rajput 19-May-14 3:33
Sachin k Rajput 19-May-14 3:33 
QuestionVBScript: Conversion XML to Excel Pin
Member 1066669818-May-14 21:39
Member 1066669818-May-14 21:39 
AnswerRe: VBScript: Conversion XML to Excel Pin
Chris Quinn18-May-14 22:52
Chris Quinn18-May-14 22:52 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669818-May-14 23:05
Member 1066669818-May-14 23:05 
GeneralRe: VBScript: Conversion XML to Excel Pin
Chris Quinn18-May-14 23:32
Chris Quinn18-May-14 23:32 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 1:10
Member 1066669819-May-14 1:10 
Okay, slowly getting there. This is what I have:

VB
Dim xlApp, xlWkb, SourceFolder,TargetFolder,file
Set xlApp = CreateObject("excel.application")
Set fs = CreateObject("Scripting.FileSystemObject")

Const xlNormal=1

filestr="D:\some directory\some file.xml"
TargetFolder="D:\some directory\xls"

xlApp.Visible = False

Set xlApp = CreateObject("Excel.Application")
Set xlWkb = xlApp.Workbooks.OpenXML(filestr, Array(1), 2)
BaseName= fs.getbasename(filestr)
FullTargetPath=TargetFolder & "\" & BaseName & ".xls"
xlWkb.SaveAs FullTargetPath, xlNormal
xlWkb.close

Set xlWkb = Nothing
Set xlApp = Nothing
Set fs = Nothing

End Sub


This will open the XML fiel, apply the style sheet and save it as a workbook. However, the code is interrupted by the opo-up window in Ezxcel prompting the user to apply the XSL fiel or not. The code continues only after clicking 'OK'. The code needs to run uninterrupted. Parameter 3 of OpenXML should be the load method: 2 = xlXmlLoadImportToList. Not sure I am using the correct parameter?
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 2:37
Member 1066669819-May-14 2:37 
GeneralRe: VBScript: Conversion XML to Excel Pin
Eddy Vluggen19-May-14 2:59
professionalEddy Vluggen19-May-14 2:59 
GeneralRe: VBScript: Conversion XML to Excel Pin
Member 1066669819-May-14 3:10
Member 1066669819-May-14 3:10 
GeneralRe: VBScript: Conversion XML to Excel Pin
Chris Quinn19-May-14 3:15
Chris Quinn19-May-14 3:15 
GeneralRe: VBScript: Conversion XML to Excel Pin
Eddy Vluggen19-May-14 7:39
professionalEddy Vluggen19-May-14 7:39 
QuestionVB.Net 2008 Pin
Virendra Singh Bhanu16-May-14 0:29
Virendra Singh Bhanu16-May-14 0:29 
AnswerRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 0:50
mveRichard MacCutchan16-May-14 0:50 
GeneralRe: VB.Net 2008 Pin
Virendra Singh Bhanu16-May-14 0:56
Virendra Singh Bhanu16-May-14 0:56 
GeneralRe: VB.Net 2008 Pin
Richard MacCutchan16-May-14 1:14
mveRichard MacCutchan16-May-14 1:14 
QuestionRe: VB.Net 2008 Pin
Eddy Vluggen16-May-14 3:02
professionalEddy Vluggen16-May-14 3:02 
QuestionList(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 3:32
Johan Hakkesteegt15-May-14 3:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Richard MacCutchan15-May-14 3:49
mveRichard MacCutchan15-May-14 3:49 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
David Mujica15-May-14 6:32
David Mujica15-May-14 6:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Eddy Vluggen15-May-14 7:53
professionalEddy Vluggen15-May-14 7:53 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 20:16
Johan Hakkesteegt15-May-14 20:16 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Mycroft Holmes15-May-14 22:41
professionalMycroft Holmes15-May-14 22:41 
QuestionWindow Service Does Not Stay "Alive" While Running Pin
ToolTimeTabor14-May-14 15:13
ToolTimeTabor14-May-14 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.