Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody!
Need help with script for reformat my table. It's an import from XML file.
Is it possible to modify this:
Header 1 | Header 2 | Header 3 |
---|---|---|
A | h | 1 |
B | h | 1 |
C | h | 1 |
a1 | v | 2 |
b1 | v | 2 |
c1 | v | 2 |
a2 | v | 3 |
b2 | v | 3 |
c2 | v | 3 |
a3 | v | 4 |
b3 | v | 4 |
c3 | v | 4 |
To table looks like:
A | B | C |
---|---|---|
a1 | b1 | c1 |
a2 | b2 | c2 |
a3 | b3 | c3 |
Sure it is! Waiting for VB sample) But previous answer from Marco is also helpful!
I think this is really one of the best solution)
Glad you like it.
regards
Marco
Sure:
Module Module1
Sub Main(ByVal Args() As String)
Dim alr As Boolean, src As String, dst As String
If Args.Length <> 3 Then
Console.WriteLine("Usage: xml2xlsx.exe Visibility Source Destination")
GoTo EOS
End If
alr = Args(0)
src = Args(1)
dst = Args(2)
Dim appe As Object
appe = CreateObject("Excel.Application")
appe.Visible = CBool(alr)
appe.displayalerts = False
appe.Workbooks.Open(src)
appe.Workbooks(1).SaveAs(dst, 51)
appe.Workbooks(1).Close()
appe.Quit()
EOS:
End Sub
End Module
And the ready command line app attached...
Parameters:
Visibility - Tells whether the excel will be visible (1) or not (0) while performing Open/SaveAs
Source - Full path to xml file
Destination - Full path to result xlsx file
like that: xml2xlsx.exe 1 e:\test\AV.xml e:\test\av.xlsx