Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Patch_Source=""
- $Patch_Dist="\\network folder\"
- $ExcelRD = New-Object -ComObject Excel.Application
- # Создаём Excel
- $filePath = "\\another network folder\\TEST.xlsm"
- $xlExcel8 = 56
- # Делаем Excel видимым
- $ExcelRD.Visible = $true
- # Отключаем уведомления
- $ExcelRD.DisplayAlerts = $false;
- # Добавляем рабочую книгу
- $WorkBook = $ExcelRD.Workbooks.Open($filePath)
- # Цепляемся к ExcelRD листу
- $WorkSheet = $ExcelRD.WorkSheets.Item(1)
- # Обновляем
- $ExcelRD.ActiveWorkbook.RefreshAll();
- $Filename = 'Bla-Bla-Bla'
- $MyDate = Get-Date -Format d
- $Collect = 'Bla-Bla-Bla_'
- $Supplier = 'Bla-Bla-Bla_'
- $Workbook.SaveAs($Patch_Dist+$Filename+$Supplier+$Collect+$MyDate+".xls",56)
- $WorkSheet = $null
- $WorkBook.Close($false)
- $ExcelRD.Quit()
- $ExcelRD = $null
- [GC]::Collect()
- [GC]::WaitForPendingFinalizers()
- [GC]::Collect()
- [GC]::WaitForPendingFinalizers()
- $connection.Close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement