Hello, Lioudmila,
There are several ways to import data from Word and Excel files into 1C. The most common is - using of COM Objects. In the case of Excel tables, I often use this way (using SpreadSheetDocument instead of COM-object):
FileOpenDialog = new FileDialog(FileDialogMode.Open);
FileOpenDialog.Filter = "Excel sheet 97 (*.xls)|*.xls|Excel workbook (*.xlsx)|*xlsx";
FileOpenDialog.Multiselect = False;
FileOpenDialog.Title = "Choose Excel file to open";
If FileOpenDialog.Choose() Then
// --- Parsing choosed file
ExcelFileName = FileOpenDialog.FullFileName;
TableDoc = new SpreadsheetDocument;
TableDoc.Read(ExcelFileName);
LinesCount = TableDoc.PageHeight;
LineNumber = 1;
ColNumber = 1;
While LineNumber <= LinesCount Do
Value = TableDoc.Area(LineNumber, ColNumber).Text; //you can use .Value property also
Message(Value);
LineNumber = LineNumber + 1;
EndDo
EndIf;
it works
it also works in the opposite direction - you can save a SpreadSheetDocument to an XLS file using
TableDoc.Write ("FileName", SpreadsheetDocumentFileType.XLSX);
use the Syntax Help on "SpreadsheetDocumentFileType: type to view all file formats