C#을 사용하여 Excel 파일을 읽는 동안 한 가지 문제가 있습니다. 내 Excel 파일에서 DateTime 인 한 열과 Excel 파일의 값이 길다. 그래서 Excel은 ###### 형식으로 변환합니다. 같은 Excel을 C#에서 동일한 값으로 C#을 사용하여 읽습니다. 누구든지 도와주십시오 : 어떻게 ##### 대신 Date Time 값을 얻을 수 있습니까? 이처럼 시도C#에서 파일을 읽는 동안 ###### 값을 얻는 중
using Excel = Microsoft.Office.Interop.Excel;
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
ExcelObj = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open(oldg.FileName, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
Microsoft.Office.Interop.Excel.Sheets sheets = theWorkbook.Worksheets;
Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)sheets.get_Item(1);
for (int i = 3; i <= worksheet.UsedRange.Rows.Count; i++)
{
var getvalue = excel_getValue("B" + i);
}
열의 크기를 조정 하시겠습니까? –
크기 조정 위치 ... –