m_oExcel As Variant m_oSheet As Variant Sub New Set m_oExcel = Nothing Set m_oExcel = CreateObject("Excel.Application") End Sub Sub NewWorkbook Call m_oExcel.Workbooks.Add Set m_oSheet = m_oExcel.Workbooks(1).Worksheets(1) End Sub Sub ActivateExcel m_oExcel.Visible = True 'Excel sichtbar machen m_oExcel.Windows(1).WindowState = -4137 m_oExcel.Windows(1).Activate m_oSheet.SaveAs sPathFile m_oSheet.Close End Sub
Sub ActivateExcel(sPathfile As String) m_oExcel.Visible = True 'Excel sichtbar machen m_oExcel.Windows(1).WindowState = -4137 m_oExcel.Windows(1).Activate m_oExcel.ActiveWorkbook.SaveAs(sPathFile) m_oExcel.ActiveWorkbook.Close(True) End Sub
An Axel: Wenn das so weiter geht, dann hast du bald eine super Klasse zum Excel Zugriff