เรียกใช้งาน using Microsoft.Office.Interop.Excel;
เมื่อเราทำการอินสแตน Class ApplicationClass ใน Microsoft.Office.Interop.Excel มาใช้มันจะยังใช้งานไม่ได้
Error ที่เกิด :
interop type 'Microsoft.Office.Interrop.Excel.ApplicationClass' cannot be embedded . use the applicable interface instead.
แก้ไขโดย
ก่อนอื่นต้อง Add References ก่อนนะ
จากนั้นคลิกขวาที่ Microsoft.Office.Interrop.Excel --> Properties
Embed Interop Types = False
เมื่อแก้ไขเสร็จแล้วจะหาย Error ครับ