Sub rpt_excel()
Dim lokasifileTemp As String
Dim namafolderTemp As String
lokasifileTemp = ActiveWorkbook.Path
namafolderTemp = lokasifileTemp & "\rpt_Temp"
If Len(Dir(namafolderTemp, vbDirectory)) = 0 Then
MkDir namafolderTemp
End If
Sheets("Olah Laporan").Select
Dim namawb As String
Dim noNIK As String
namasheet = Sheet3.Range("F39").Value
namawb = ActiveWorkbook.Path & "\rpt_Temp\" & Sheet3.Range("F39").Value & "_" & Format(Now, "yymmddhhmmss") & ".xlsx"
Sheets("Olah Laporan").Copy
ActiveWorkbook.SaveAs FileName:=namawb, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
Sheets("Olah Laporan").Select
Sheets("Olah Laporan").Name = namasheet
ActiveWorkbook.Save
ActiveWindow.Close
Dim appXL As New Excel.Application
appXL.Workbooks.Open namawb
appXL.Visible = True
End Sub
0 komentar:
Posting Komentar