Public Function Set_Sheet_Viborka(Patch_Name As String, Sheet_Name As String)
'Ïå÷àòü ïðîèçâîëüíîé âûáîðêè
Dim MyRst As DAO.Recordset
Set MyRst = CurrentDb.OpenRecordset("Pay_Reestr_QUE", dbOpenDynaset)
If MyRst.EOF Then 'ïðîâåðêà íàëè÷èÿ ïîñòóïëåíèé ïëàòåæåé
' ïî äàííîìó âèäó ïëàòåæà
NET_Postuplenii = Nz(NET_Postuplenii) & vbCrLf & "Íåò ïîñòóïëåíèé " & Sheet_Name
Set MyRst = Nothing
Exit Function 'ïðîâåðêà íàëè÷èÿ ïîñòóïëåíèé ïëàòåæåé
' ïî äàííîìó âèäó ïëàòåæà
End If
Set xl = CreateObject("Excel.Application")
Set xlBook = xl.Workbooks.Add
Set xlSheet = xl.Worksheets(1)
xl.Application.Visible = True
xl.Parent.Windows(1).Visible = True
xl.Range("a1:h1").Merge
xl.Range("A1").Select
xl.ActiveCell.FormulaR1C1 = "ÊÊÌ - " & Mid(Sheet_Name, 1, 1)
With xl.ActiveCell.Characters(Start:=1, Length:=19).Font
.Name = "Arial Cyr"
.FontStyle = "îáû÷íûé"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With xl.Selection
.HorizontalAlignment = ActiveCell.xlCenter
.VerticalAlignment = ActiveCell.xlBottom
End With
|