Create Excel Xml Mapping from Powershell -


from powershell, access excel file, convert 1 sheet table , link table xml using mapping. know how in excel , it's working want powershell.

$app = new-object -comobject excel.application $wb = $app.workbooks.open($excelfilepath) $listobject = $app.activesheet.listobjects.add([microsoft.office.interop.excel.xllistobjectsourcetype]::xlsrcrange, $app.activecell.currentregion, $null ,[microsoft.office.interop.excel.xlyesnoguess]::xlyes) $listobject.name = "tabledata" 

above open excel, convert sheet table. next load mapping:

$map = $wb. xmlmaps.add("d:\mymap.xsd", "activity").name = "activity_map" 

now last step link mapping excel (table) columns (ex: column 5):

$listobject.listcolumns.item(5).xpath.setvalue($map, "/activity/event/", <?> , <?> ) 

don't know set, these optional error raised if not set.

from msdn, found these parameters are: selectionnamespace (variant) & repeating (variant) http://msdn.microsoft.com/en-us/library/office/ff836812%28v=office.15%29.aspx

can help, please?

thanks,


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -