hi friends,
I want o convert the Excel document into tiff using the MODI . I had tried the following code but it
Dim AppExcel AsNew Microsoft.Office.Interop.Excel.Application
Dim objCurrentDoc AsNew Microsoft.Office.Interop.Excel.Workbook
objCurrentDoc = AppExcel.Documents.Add("C:\workings.xls")
AppExcel.ActivePrinter = "Microsoft Office Document Image Writer"
objCurrentDoc.PrintOutEx(PrintToFile:="c:\workings.tif")
objCurrentDoc.Close()
AppExcel.Quit()
throws an error in second line
System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2147221164
Message="Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154."
Source="DocumentConvertor"
StackTrace:
at DocumentConvertor.Form1.ConvertExcelToTiff() in C:\
Vb.net\DocumentConvertor\DocumentConvertor\Form 1.
vb:line 35 at DocumentConvertor.Form1.Form1_Load(Object sender, EventArgs e) in C:\
Vb.net\DocumentConvertor\DocumentConvertor\Form 1.
vb:line 17 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m) at System.Windows.Forms.ContainerControl.WndProc(Mess age& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolea n value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationCo ntext context) at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine) at DocumentConvertor.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.
vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context( Object state) at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Any ideas mate...pls share
Thanks
vijay