10
A
답변
23
:
using Excel;
Excel.Application excelApp = new Excel.ApplicationClass();
// if you want to make excel visible to user, set this property to true, false by default
excelApp.Visible = true;
// open an existing workbook
string workbookPath = "c:/SomeWorkBook.xls";
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath,
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);
// get all sheets in workbook
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
// get some sheet
string currentSheet = "Sheet1";
Excel.Worksheet excelWorksheet =
(Excel.Worksheet)excelSheets.get_Item(currentSheet);
// access cell within sheet
Excel.Range excelCell =
(Excel.Range)excelWorksheet.get_Range("A1", "A1");
희망이 도움이
MDSN 정보 here
+0
.Visible = True로만 작동합니다. 어떻습니까? Visible = False? – Denis
3
이런 일에 대해 무엇 : (안된)이 같이
//using Excel = Microsoft.Office.Interop.Excel;
Excel.ApplicationClass app = new Excel.ApplicationClass();
Excel.Workbook workbook = app.Workbooks.Open("YourFile.xls",
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);
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Sheets["Number 3"];
worksheet.Activate();
1
시각적 피드백을 제공하고자하는 경우 사용자에게이 두 문장은 활성화 된 시트를 설정하고 se 이에 따라 범위를 lect :
은 Excel.Range를 초기화 직전에 다음과 같은 성명을 포함하여 고려 ...// 설정 활성 시트를 Excel에서
excelWorksheet.Activate을() 또한
Excel.Range를 초기화 한 직후에 다음 구문을 고려하십시오.
// Excel에서 활성 범위 설정
excelCell.Activate()
0
public static Workbook openExternalWorkBook(String fileName)
{
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
excel.Visible = false;
return excel.Workbooks.Open(fileName, false);
}
관련 문제
- 1. 특정 워크 시트 열기 97-2003 워크 시트의 Excel
- 2. URL의 Excel 파일 워크 시트 열기
- 3. 두 Excel 워크 시트의 차이점을 찾으십니까?
- 4. Excel 매크로 - 특정 단어 파일 열기
- 5. Excel Interop 워크 시트의 ScrollBar 조작
- 6. Excel 파일 열기 C#
- 7. Excel 시트의 이상한 문제
- 8. 특정 디스크의 파일 열기
- 9. Excel 시트의 이미지 보호 방법
- 10. Excel 시트의 딥 링크를 html로 내 보낸
- 11. Excel 시트의 필드 비교
- 12. javamail의 전자 메일에 Excel 워크 시트의 내용을 포함시키는 방법은 무엇입니까?
- 13. Perl에서 Excel 워크 시트의 차원을 얻는 방법은 무엇입니까?
- 14. Excel 작업 시트의 시간대 변환
- 15. 기본 프로그램을 사용하여 Excel 파일 열기
- 16. Tcl Tk로 Excel 및 PDf 파일 열기
- 17. asp.net을 사용하여 Excel 시트의 셀에 값을 삽입하는 방법
- 18. 델파이가있는 Excel 시트의 각 행에 이미지 삽입
- 19. C에서 Excel 통합 문서 열기
- 20. Sharepoint 순차 워크 플로의 Excel 파일 편집
- 21. VB.NET 쉘 특정 페이지로 PDF 파일 열기
- 22. 앵커 태그에서 특정 페이지가있는 파일 열기
- 23. 특정 지점에서 로컬 PDF 파일 열기
- 24. 자바를 사용하여 Excel 시트의 단일 열을 읽습니다.
- 25. Rails에서 Excel 스프레드 시트의 표를 채우려면 어떻게해야합니까?
- 26. Excel vba : 엑셀 시트의 편집 영역을 제한하십시오.
- 27. OLEDB 연결이 Excel 시트의 데이터를 읽지 않습니다.
- 28. VB.NET을 통해 Excel 시트의 셀 색상 변경
- 29. Excel 스프레드 시트의 복수 셀 배경 색
- 30. PHP를 사용하여 Excel 시트의 행을 삭제하는 방법
Excel을 자동화 하시겠습니까? 아니면 응용 프로그램의 눈금에 데이터를 표시 하시겠습니까? 또는 다른 것? –