Eğer excelden veya formdan yazdırma işlemini yaptıktan sonra kapat butonuna aşağıdaki kodu deneyiniz.
Kod:
Set LABEL = Nothing
Sn:starturk
Hemen hemen aynı özellikler sahip bir yazdıma programını Excel UserFormdan kulanılmış kodları size fikir verbilir.
Kod:
Dim MRobj As Object
Private Sub cmdYazdir_Click()
If ListBox1.Text <> "" Then
MRobj.StartReport (ListBox1.Text)
Else
MsgBox ("Raporda Yazılacak Birşey Yok")
End If
End Sub
Private Sub cmdKapat_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim cnt As Integer
Dim i As Integer
Set MRobj = CreateObject("MetaReport.MetaReportApp")
MRobj.parentwindow = Application.Hwnd
MRobj.ProjectsPath = "C:\MetaReports"
cnt = MRobj.ReportCount
For i = 0 To cnt - 1
Me.ListBox1.AddItem MRobj.ReportID(i)
Next i
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Set MRobj = Nothing
End Sub