Click here to Skip to main content
Click here to Skip to main content

How to Integrate Excel in a Windows Form Application using the WebBrowser

By , 1 Oct 2006
 

Sample Image - Embedding_Excel.jpg

Introduction

With Automation, you are able to drive any Office application from your .NET application. This is really powerful. It may happen that one time, you would like to integrate such an application (Excel, for example) in your own application, and handle it like a control. A first approach has already been published on The Code Project (see the Background section in this article). The other method I will describe here uses the Microsoft WebBrowser control as a host for the document.

Background

You can study Anup Shinde's article. His method works fine. Instead of the WebBrowser control, it is based on Windows Win32 API.

If you are interested in the original publication of the WebBrowser method, you can see the Microsoft KB.

Starting from scratch

Create a new form MyForm, and add a new WebBrowser control, named webBrowser1. Add the m_ExcelFileName field :

// Contains the path to the workbook file
private string m_ExcelFileName="test.xls"; // Replace here with an existing file

Then create a function OpenFile like this :

public void OpenFile(string filename) 
{
    // Check the file exists
    if(!System.IO.File.Exists(filename)) throw new Exception();
        m_ExcelFileName=filename;
    // Load the workbook in the WebBrowser control
    this.webBrowser1.Navigate(filename,false);
}

You can try and run your application, giving the filename an existing excel file path. You'll see that it works perfectly. Really easy, don't you think?

In fact, you will quickly get into trouble if you try to run the application a second time with the same Excel file. An error message tells you that your file is already in use. This may be strange because you think that you closed your application, and you did. So where is the problem?

Let's see what happened in the background. While the WebBrowser was navigating, it opened an invisible Excel application, and loaded the workbook inside it. And when you closed your application, the WebBrowser didn't close either its Excel application or the workbook. So we must do it, and this is the most difficult part of our job.

Solving the problem step by step

Before further reading, you have to load the following Office COM library references for Office Automation :

  • Microsoft Excel 11.0 Object Library
  • Microsoft Office 11.0 Object Library

and use them in your file :

using Microsoft.Office.Core;
using Microsoft.Office.Interop.Excel;

You'll need these assemblies too :

using System.Runtime.InteropServices;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;

Declare these two Excel fields :

// Contains a reference to the hosting application
private Microsoft.Office.Interop.Excel.Application m_XlApplication=null;
// Contains a reference to the active workbook
private Workbook m_Workbook=null;

Before trying to close the workbook, we need a handle on it. For convenience, the best moment to do this is just after the document has been loaded in the WebBrowser. So we have to generate a webBrowser1_Navigated event handler and its matching function, like this :

private void webBrowser1_Navigated(object sender,WebBrowserNavigatedEventArgs e) 
{
    // Creation of the workbook object
    if((m_Workbook=RetrieveWorkbook(m_ExcelFileName))==null)return;
    // Create the Excel.Application
    m_XlApplication=(Microsoft.Office.Interop.Excel.Application)m_Workbook.Application;
}

Then we define the RetrieveWorkbook function. It is based on two imported Win32 API functions, that retrieve all the programs that are running on our computer. Our job is to search among them the one that is working with the workbook that names xlfile. The code is like this :

[DllImport("ole32.dll")] static extern int GetRunningObjectTable
                (uint reserved,out IRunningObjectTable pprot);
[DllImport("ole32.dll")] static extern int CreateBindCtx(uint reserved,out IBindCtx pctx);

public Workbook RetrieveWorkbook(string xlfile) 
{
        IRunningObjectTable prot=null;
        IEnumMoniker pmonkenum=null;
        try 
        {
            IntPtr pfetched=IntPtr.Zero;
            // Query the running object table (ROT)
            if(GetRunningObjectTable(0,out prot)!=0||prot==null) return null;
            prot.EnumRunning(out pmonkenum); pmonkenum.Reset();
            IMoniker[] monikers=new IMoniker[1];
            while(pmonkenum.Next(1,monikers,pfetched)==0) 
            {
                IBindCtx pctx; string filepathname;
                CreateBindCtx(0,out pctx);
                 // Get the name of the file
                 monikers[0].GetDisplayName(pctx,null,out filepathname);
                 // Clean up
                 Marshal.ReleaseComObject(pctx);
                 // Search for the workbook
                 if(filepathname.IndexOf(xlfile)!=-1) 
                 {
                     object roval;
                     // Get a handle on the workbook
                     prot.GetObject(monikers[0],out roval);
                     return roval as Workbook;
                 }
              }
         } 
         catch 
         {
             return null;
         } 
         finally 
         {
             // Clean up
             if(prot!=null) Marshal.ReleaseComObject(prot);
             if(pmonkenum!=null) Marshal.ReleaseComObject(pmonkenum);
         }
         return null;
}

Now we can write the code involved to close the background Excel application, while overriding the OnClose() event :

protected override void OnClosed(object sender, EventArgs e) 
{
    try 
    {
        // Quit Excel and clean up.
        if(m_Workbook!=null) 
        {
            m_Workbook.Close(true,Missing.Value,Missing.Value);
            System.Runtime.InteropServices.Marshal.ReleaseComObject
                                    (m_Workbook);
            m_Workbook=null;
        }
        if(m_XlApplication!=null) 
        {
            m_XlApplication.Quit();
            System.Runtime.InteropServices.Marshal.ReleaseComObject
                                (m_XlApplication);
            m_XlApplication=null;
            System.GC.Collect();
        }
    } 
    catch 
    {
        MessageBox.Show("Failed to close the application");
    }
}

Using the code

You can use the code as written upper. Otherwise, it may be interesting to embed all the stuff in a .NET control. You'll be able to manage CommandBars, Menus, etc. inside the control. You will find some code in the downloadable package section.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

bsargos
Software Developer
France France
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionExcel opens outside the WebBrowser control Pinmembertieuqui905 May '13 - 23:58 
Sorry! I have downloaded and run code on the market it does not run as you present. I do not know how fix this error? Can you help me? Thank you very much!
(Error :Navigation to the webpage was canceled
What you can try:
Retype the address.
)
QuestionWhen I integrate this in WPF Usercontrol the Excel Opens in new window where your example(Win forms) opening in web browsermemberMember 99615323 Apr '13 - 4:41 
Hi,
 
When am running your sample application its working fine(opening excel in webbrowser) but when i integrate this in WPF Usercontrol,excel opens in new window instead of webbrowser..Do you have any clue regarding this issue???
 
Thanks,
Suhas
QuestionCommand Bar not workingmemberArvind50214 Mar '13 - 6:15 
I am using VS 2010 to view the project,I had to delete the reference for "Microsoft.Office.Core" and add the reference for "Microsoft Office 12.0 Object Library" version 2.4 to run the application without errors. Application works fine. it opens up excel within the windows form.
 
But, the command bar doesn't show up (even if i check the CommandBarVisible Checkbox). any ideas on how to fix this problem?
 
Also, i am using this application to open excel connected to SSAS Cube. is there a way to display the "pivot table field list" within the application? so that users can browse the cube. all other pivot table options work great.
 
Any help is appreciated.
QuestionExcel opens directly instead of opening in Web Browser!!!!!memberMember 765864611 Feb '13 - 19:54 
Hello,
 
I m facing problem that When I click on Open File button dialog box is open and then selecting excel file it open directly in Microsoft Office Excel instead of open in our Web Browser Control.
 
Please help......
BugExcel opens outside the WebBrowser controlmembernilesh Karekar7 Jan '13 - 23:33 
Hi bsargos,
 
I tried executing your project to Integrate Excel in a Windows Form Application using the WebBrowser.
But surprisingly the excel sheet does not open in the WebBrowser control.
Instead it opens as a separate Excel sheet document outside my form.
Can you please explain why this must be happening and what should I do so that the excel sheet opens inside the WebBrowser control?
 
Thanks in Advance,
Prachi.
 
Additional email Id: prach27@gmail.com
Please email me on the above email id too.
BugRe: Excel opens outside the WebBrowser controlmemberMirco Feliziani8 Jan '13 - 4:19 
I' have same problem! Someone can help us?
GeneralRe: Excel opens outside the WebBrowser controlmemberLostMan_11 Jan '13 - 0:41 
Read this link and apply the registry setting first after that u can open it in your browser...
 
http://support.microsoft.com/kb/927009[^]
GeneralRe: Excel opens outside the WebBrowser controlmemberSuperShade14 Jan '13 - 8:44 
Even with the registry settings applied, when I already have an instance of Excel open, the file will open there instead of the embedded browser. I may try the other solution you linked to.
QuestionHow to save the excel opened in web browser???memberAdie151123 Dec '12 - 17:50 
I am trying to save the excel opened in web browser control, I have made some changes and trying to save it but its not getting saved.
Can you help me with this..plzz
Questionhow can we implement search functionality programatically while it was loadingmemberV G S Naidu A16 Dec '12 - 18:41 
hai,
This code working well.but i need to search the data in excel sheet programatically using the C#. How can i implement programatically.
When i loading the Excel sheet it showing the Popup window by asking to open,Save or cancel. i need to restrict that popup what to do?
 
Thank you
QuestionHow to Integrate Excel in WebForm asp.netmemberXuan Dung Phu Yen25 Aug '12 - 23:08 
How to Integrate Excel in WebForm asp.net C#. Please help me. Thanks.
Generalthanks a lotmemberatul don19 Jun '12 - 18:02 
really it is very helpful in creating new thing using this
QuestionThis article is outdated and doesn't work using IE9...memberxzz01958 Jun '12 - 11:15 
MSFT has decided that if you embed the System.Windows.Forms.Webbrowser control into your application, the code above no longer works! What happens instead is the file open is treated like and XLS download instead. Haven't figured out a way to overcome this yet.
QuestionIn VS2008membernatmanju6 Oct '11 - 3:39 
Hi, I am not able to compile this in VS 2008, i am beginer in this, please help.
QuestionDisplay excel in winform with c#memberkienhv_875 Oct '11 - 23:01 
I used web browser control to integate excel like this but only show save as dialog and web browser display :"Navigation to the webpage was canceled".
Please help me!!
Thks!
AnswerRe: Display excel in winform with c#memberJayaprakash Subramanian17 Feb '12 - 4:25 
i am also having same problem.
 
In the WEB browser, getting an error as
 
Navigation to the webpage was canceled
 
Anyone could help me?
QuestionReading Cellsmemberakshay238629 Sep '11 - 2:28 
How do I read the Excel file? For instance display content of cell 1 in a Message Box.
AnswerPlease note that: A new window opens when you try to view a 2007 Microsoft Office program document in Windows Internet Explorer 7 or Internet Explorer 8membersuicideas30 Jun '11 - 7:31 
A new window opens when you try to view a 2007 Microsoft Office program document in Windows Internet Explorer 7 or Internet Explorer 8
http://support.microsoft.com/kb/927009/[^]
the only way to avoid this problem is setting registery values mentioned in this article!
GeneralRe: Please note that: A new window opens when you try to view a 2007 Microsoft Office program document in Windows Internet Explorer 7 or Internet Explorer 8memberbjxdylzsts19 Sep '11 - 1:05 
In windows xp,it does work well.But My computer runs Win7 ,and i can't modify registers according to the methords given above :(
GeneralMy vote of 5membersuicideas30 Jun '11 - 7:26 
The best solution!
GeneralCommande bar not showing [modified]membermaatallah16 May '11 - 22:58 
Hi,
think your for the article
 
I used your ExcelWrapper in an application; and i use excel 2007 vs 2010
the commandbar is not showing although it's setting is default true
think you sir for help

modified on Wednesday, May 18, 2011 5:08 AM

GeneralRe: Commande bar not showingmembermaatallah17 May '11 - 23:08 
Hi,
think your for the article

I used your ExcelWrapper in an application; and i use excel 2007 vs 2010
Evry think is good (work)but the commandbar is not showing although it's setting is default true
***** m_StandardCommandBar is not null *********
help me please and think you sir
GeneralCannot see the excel in the AppsmemberLouisyu3236 Jan '11 - 17:37 
In Your C# form , I open excel file (.xls) ok it is fine. However, the Excel cannot be import into the C# window application.
Questionembedding protected excel file?memberpeejay0215 Nov '10 - 19:57 
how can i embed the excel file if it is protected or if it has password?Confused | :confused:
i already tried using
 
Excel.Application xlApp = new Excel.Application();
Excel.Workbooks xlWBs = (Excel.Workbooks)xlApp.Workbooks;
Excel._Workbook xlWB = (Excel._Workbook)(xlWBs.Add(MISS));
try
{
xlWB = xlApp.Workbooks.Open(m_ExcelFileName, 0, false, MISS, "passWord", "", MISS, MISS, MISS,
MISS, MISS, MISS, MISS, MISS, MISS);
}
catch (Exception)
{
throw;
}
xlWB.Save();
xlWB.Close(true, MISS, MISS);
xlApp.Quit();
QuestionCommand Bar not showingmemberMember 377294928 Jul '10 - 2:16 
Hi,
 
I used your ExcelWrapper in an application. Everything works. Only the commandbar is not showing although it's setting is default true. If I open the Excel file in a normal IE browser then the commandbars do show. Any ideas?
 
Kind regards,
Ben
AnswerRe: Command Bar not showingmemberkyh2000b30 Mar '11 - 22:18 
check "if(filepathname.IndexOf(xlfile)!=-1)" in ExcelWrapper.cs
GeneralOpens Excel 2007 in another windowmembersnorlaks25 May '10 - 23:24 
Hello,
 
When I use this application after OpenFile new instation of Excel is opened and it is not embeded in this app. How can I make it embedded in webBrowser ?
GeneralReference Errors Fix and "New" and "Open" bugs on Command Bar Excel Interop is dumb!!!!!memberxzz019524 Nov '09 - 11:18 
Downloaded and Ran this example..
 
First off I had to change a few references...as follows:
1) I removed the current reference to excel because it came up in error on my machine. I then added a new reference pointing to Microsoft Excel 9.0 Object Library. That appeared to fix the Microsoft Excel reference errors
 
2) I had to change the using statements in the ExcelWrapper to this:

using Microsoft.Office.Core;
using Excel;

 
I recompiled the project closed all windows and reopened in IDE and all of the forms displayed perfect.
 
I then ran the application in debug mode and ran into the following problem, which is not particular to this application. Rather I've seen this in Any Webbrowser hosting Excel.
 
Problem: If you click on the checkbox "CommandBar visible" and then click on the New icon, nothing happens or if you click on the Open Icon, you will wait for a long time and then see this: The open dialog will open but is disabled, after a while a COM Exception is thrown..."Microsoft Excel is waiting for another application to complete an OLE action", which is probably Excel waiting for someone to type something into the DISABLED Open window. If you click ok to that message the Open window suddenly is ENABLED and you can actually type something in it and navigate ok.
 
This is a ridiculous problems that demonstrates how bad Excel Interop is, something as simple as a NEW or OPEN command being sent to excel just doesn't work and guess what, I've searched for days trying to find the answer and it's only in the heads of MSFT engineers as far as I can tell.
GeneralRe: Reference Errors Fix and "New" and "Open" bugs on Command Bar Excel Interop is dumb!!!!!memberxzz019524 Nov '09 - 11:31 
Other changes needed in Excel Wrapper.cs (none of these work so remove them)
 
foreach(Office.CommandBarControl control in m_StandardCommandBar.Controls) {
					string name = control.get_accName(Missing.Value);
                    if (name.Equals("New")) { 
                         ((Office.CommandBarButton)control).Enabled = false;
                         ((Office.CommandBarButton)control).Visible = false;
                    }
                    if (name.Equals("Open"))
                    {
                        ((Office.CommandBarButton)control).Enabled = false;
                        ((Office.CommandBarButton)control).Visible = false;
                    }
                    if (name.Equals("Mail Recipient"))
                    {
                        ((Office.CommandBarButton)control).Enabled = false;
                        ((Office.CommandBarButton)control).Visible = false;
                    }
                    if (name.Equals("Print Preview"))
                    {
                        ((Office.CommandBarButton)control).Enabled = false;
                        ((Office.CommandBarButton)control).Visible = false;
                    }
				}

QuestionHow to Open blank sheet and let user create new worksheet ,open worksheet .memberlowanshi14 Oct '09 - 20:33 
This article opens an existing xls.How can we present a blan worksheet on startup?How to Show the Menu bar?
GeneralAlternativememberFilipKrnjic14 Jul '09 - 2:55 
Hi,
 
nice article but Interop is very slow and complicated way to work with Excel in .NET. You should try working with GemBox Excel component which comes free for commercial use (limit is 150 rows).
 
Here you can see a list of reasons why it is better to use GemBox component then Excel Interop.
 
Filip
GemBox Software - easier and faster way to deal with Excel then Excel Interop
QuestionHow to add components to MenuBarmemberinisider8 Jul '09 - 19:53 
I have some question.
How to add menu to project another menu that is in Excel?
Generalcom object that has been separated from its underlying RCW cannot be usedmembersharma.monal22 Jan '09 - 23:04 
Hi,It's a great article and very nice code to understand however when I converted the code ito VB.NET framwork version 1.1 (As per my requirement) as below, I am getting error "com object that has been separated from its underlying RCW cannot be used " in the function GetActiveWorkbook' and also while I release the excel object. I have highlighted the lines on which I am getting the error.
 

<DllImport("ole32.dll")> _
Private Shared Function GetRunningObjectTable(ByVal reserved As Int32, ByRef pprot As UCOMIRunningObjectTable) As Integer
End Function
<DllImport("ole32.dll")> _
Private Shared Function CreateBindCtx(ByVal reserved As Int32, ByRef pctx As UCOMIBindCtx) As Integer

**Code for GetACtiveWorkbook function. I get error on the function GetDisplayName**
 
Public Function GetActiveWorkbook(ByVal xlfile As String) As Workbook
 
Dim prot As UCOMIRunningObjectTable = Nothing
Dim pmonkenum As UCOMIEnumMoniker = Nothing
Try
Dim pfetched As IntPtr = IntPtr.Zero
' Query the running object table (ROT)
If GetRunningObjectTable(0, prot) <> 0 OrElse prot Is Nothing Then
Return Nothing
End If
prot.EnumRunning(pmonkenum)
pmonkenum.Reset()
Dim monikers As UCOMIMoniker() = New UCOMIMoniker(0) {}
While pmonkenum.Next(1, monikers, 0) = 0
Dim pctx As UCOMIBindCtx
Dim filepathname As String
CreateBindCtx(0, pctx)
' Get the name of the file
monikers(0).GetDisplayName(pctx, Nothing, filepathname)
' Clean up
Marshal.ReleaseComObject(pctx)
' Search for the workbook
If filepathname.IndexOf(xlfile) <> -1 Then
Dim roval As Object
' Get a handle on the workbook
prot.GetObject(monikers(0), roval)
roval = CType(roval, Workbook)
Return roval
End If
End While
Catch ex As COMException
Throw ex
Catch ex As Exception
Throw ex
Finally
' Clean up
If Not prot Is Nothing Then
Marshal.ReleaseComObject(prot)
End If
If Not pmonkenum Is Nothing Then
Marshal.ReleaseComObject(pmonkenum)
End If
End Try
'Return Nothing
End Function
 

**Code to release the object(Here also I am getting this error)on the highlighted line**
 
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
Try
If Not m_workbook Is Nothing Then
m_workbook.Close(False, refmissing, refmissing)
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_workbook)
m_workbook = Nothing
End If
If Not m_XlApplication Is Nothing Then
m_XlApplication.Close(False, refmissing, refmissing)
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_XlApplication)
m_XlApplication = Nothing
System.GC.Collect()
End If
 
Catch ex As Exception
 
End Try
MyBase.Dispose(disposing)
End Sub
 
Could you please help me understand as why am i getting the error and how can I remove it.
QuestionExcel sheet is opening seperatelymemberMember 472451215 Jan '09 - 0:46 
Excel sheet is opening seperately but I want that with in the window form.
 
I have given navigation option false as follows in EmbeddedExcel.ExcelWrapper.OpenFile() method
 
this.WebBrowserExcel.Navigate(filename,false);
 
Please help me.
 
Thanks & Regards,
Nishant
AnswerRe: Excel sheet is opening seperatelymemberFessen3 Sep '09 - 4:01 
If it is Office 2007:

http://support.microsoft.com/kb/927009/[^]
[^]
GeneralRegarding Print Preview of Shown excell Filememberkishorekumar BV16 Dec '08 - 20:48 
Hi this is Kishore ,
I have used your Class Its Working Fine But I need Print Preview of File Shown
Please Help me
GeneralGetActiveWorkbook(string xlfile) method returns null workbook while XMLSS file wants to openmemberPrit19742 Sep '08 - 1:02 
Hi,
 
This article is a great help to understand ROT. Here to metion that if any xls file needs to show in my .net form then its working fine but if I try to open any file suppose named - New Microsoft Excel Worksheet.xls.xml (in XMLSS format), this demo project unable to return any workbook object from "public Workbook GetActiveWorkbook(string xlfile)" method. So as a result I am not getting any toolbar on top of the opened XMLSS file. Can u plz give a solution of how to show toolbar of a said opened XMLSS file (New Microsoft Excel Worksheet.xls.xml). I except ur response.
 
Thanks
Prit.
AnswerRe: GetActiveWorkbook(string xlfile) method returns null workbook while XMLSS file wants to openmemberdereklk24 Jan '10 - 17:23 
This is really old, but I also came across this issue and came up with a solution that may work for someone else.
 
For some strange reason when the below line of code is returned and it actually has finally found the excel workbook my program is openining, it changes the path from
back slashes - something like "C:\Docs and Settings\Some File.xls" (like it has on every other file in the enumeration) to forward slashes - "C:/Docs and Settings/Some File.xls". Therefore the match is never found since the "xlfile" string contains back slashes also.
 
monikers[0].GetDisplayName(pctx,null,out filepathname);
 

Resolution:
add the following line of code just after the one shown above:
filepathname = filepathname.Replace("/", "\\");

GeneralThe project doesnt work in VS 2008memberatef78651 Aug '08 - 10:45 
I have tried to implement this project in VS 2008. Even the demo doesnt work in it. It simply opens the file in question in excel not in the webbrowser.
a little help in this regard is appreciated.
 
thanks
Generalhimembervikram12312 Jun '08 - 19:09 
Actually i have a container application where i can open an Excel file easily. but if suppose another excel file is already opened and i launch my container application and open anothere excel file through my application. then first application hang or disable.if you do print previewthen if happens most. Please help me what to do if both application should alive
 

vikram
Questionclosing word???membersalihovic2 Jun '08 - 22:39 
hi;
fow word object how to do to retrive the document in use and other things???
 
nice to meet you

Questionafter opening an xls document and leaving the app the file is already in usemembersalihovic2 Jun '08 - 1:20 

hi;
thanks for this good source
when I used your code and I added in the onFormClosing event a code that delets the file ther are an exception
the file cannot be deleted it is in use by an other process
if you can modify the code or give me an other idea to release the excel object
thanks for help

 
nice to meet you

AnswerRe: after opening an xls document and leaving the app the file is already in usememberRatamahatta19 Jul '08 - 22:56 
There is more easy way to destroy Excel object:
 
Marshal.ReleaseComObject(excel);
GC.GetTotalMemory(true);
 
I prefer this sample[^]
 
Have fun!
Smile | :)
GeneralVS2008 and xls 2007memberPL0118 Apr '08 - 11:20 
Hi,
i'm encountering problem with operating office 2007 - it just won't open excel file into WebBrowser, it goes into excel separate window. gosh Confused | :confused:
 
/PL01

GeneralRe: VS2008 and xls 2007memberasukanet28 May '08 - 16:15 
http://support.microsoft.com/kb/927009/[^]
QuestionProblem with the Most Recently Used file of Excelmemberklew26 Feb '08 - 5:49 
Hello,
 
I used the code that you posted above (method RetrieveWorkbook) to release the excel file. Doing that solves the "file already in use" problem and so, I can open the file again using ctrl-O or by using the File->Open menu option. However, opening the file through the list of most recently used files (MRU) appears not to work.
 
The problem is: if I have an existing stand-alone excel application instance that was already running, then even after closing a file using method RetrieveWorkbook in my .NET app, Excel will not open the file if I use the MRU to open the file. No error message is displayed by Excel.
 
Any pointers on how I could address that problem?
 
Thanx,
 
Kevin
GeneralGreat article! Thanx.memberklew15 Feb '08 - 6:48 
Looping to find the excel file and releasing it solved my problem. Thanx!
QuestionIncorrect redraw...memberAndreyVT17 Jan '08 - 23:50 
Anyone test this method for open more than one excel file in app?
Incorrect redraw... visual bags...
bad
GeneralMicrosoft ActiveX for Embedding Office Documents in Visual Studio FormsmemberDrTom26 Sep '07 - 14:58 
After playing around with the concepts outlined in this article, I discovered that Microsoft has recently developed an ActiveX control for the same embedding Office documents in Visual Studio forms.
The reference web address decribing the ActiveX control and link to the sample download page is:
http://support.microsoft.com/?id=311765
Worth checking out.
DrTom2

QuestionDrag&amp;drop to excel from C# Form [modified]memberGwidon3410 Aug '07 - 0:15 
Hi,
your project is very, very useful for me, but could you give me any suggestion how to insert any i.e. text from text field control on form to any cell in excel using drag&drop method?
 
Thank
Gwidon
 

-- modified at 17:34 Sunday 12th August, 2007

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 1 Oct 2006
Article Copyright 2006 by bsargos
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid