Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $excel = New-Object -ComObject Excel.Application
- $excel.Visible = $false
- $workbook = $excel.Workbooks.Open("C:testexcel.xls")
- $binding = "System.Reflection.BindingFlags" -as [type]
- Foreach($property in $workbook.BuiltInDocumentProperties)
- {
- $pn = [System.__ComObject].invokemember("name",$binding::GetProperty,$null,$property,$null)
- trap [system.exception]
- {
- write-host -foreground blue "Value not found for $pn"
- continue
- }
- "$pn`: " +
- [System.__ComObject].invokemember("value",$binding::GetProperty,$null,$property,$null)
- }
- $excel.quit() </code> <br> Can someone please assist:
- [System.__ComObject].invokemember("name",$binding::GetProperty,$null,$property,$null)
- $lst=$workbook.BuiltinDocumentProperties("Last Save Time")
- [System.__ComObject]$lst.invokemember("value",$binding::GetProperty,$null,$property,$null)
Add Comment
Please, Sign In to add comment