Results 1 to 4 of 4

Thread: C# getting running Excel Application

  1. #1
    Join Date
    May 2008
    Posts
    222

    C# getting running Excel Application

    I want to open a file from a Class in C# using a Process, I know that it is easy to embed an excel workbook (spreadsheet) in a .Net Winform program therefore I have created a Word and PowerPoint Application object, i tried to open it to check the changes made are proper but when I try to create one for Excel, I get the build error:

    "Cannot create an instance of the abstract class or interface 'interface'"

    The real problem arises when there is a stand-along Excel application already running before launching an Excel-embedded Winform. I even added code to the Service that opens a binary .dat file from the hard drive (not in Isolated Storage) and reads in some arbitrary values - this works fine under the console application and Windows Service, thereby proving the Windows Service has elevated trust.

  2. #2
    Join Date
    Jan 2009
    Posts
    99

    Re: C# getting running Excel Application

    To fill a multi-cell range without populating cells one at a time, you can set the Value property of a Range object to a two-dimensional array. The standard way to create an event handler is to use the Handles keyword with the WithEvents keyword. When you declare a variable by using the WithEvents keyword, Visual Basic .NET automatically connects to the events of that object at run time.

  3. #3
    Join Date
    Jan 2006
    Posts
    211

    Re: C# getting running Excel Application

    Try using a string literal, my research shows that automation is an issue with Windows Server 2008, specifically the 64-bit version. you may also search at the following location,

    startInfo.Arguments = @"C:\Users\un\Desktop\file with space"

    There are a number of different ways to programmatically extend, to automate, to integrate, or to use Office in your development solution.

  4. #4
    Join Date
    Feb 2009
    Posts
    105

    Re: C# getting running Excel Application

    The .NET-managed languages use common data type system in the common language runtime.
    1. Build the Automation Client for Microsoft Excel
    2. Start Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET.
    3. On the File menu, click New, and then click Project. Select Windows Application from the Visual C# Project types. Form1 is created by default.
    4. Add a reference to Microsoft Excel 11.0 Object Library in Visual Studio 2005 or Microsoft Excel Object Library in Visual Studio .NET. To
      do this, follow these steps:
      • On the Project menu, click Add Reference.
      • On the COM tab, locate Microsoft Excel Object Library, and then click Select.

Similar Threads

  1. Running application from a different partition
    By aSITA in forum Operating Systems
    Replies: 4
    Last Post: 19-01-2011, 07:40 AM
  2. Mac gets hang on running some application
    By Toraidio in forum Operating Systems
    Replies: 5
    Last Post: 04-03-2010, 02:29 PM
  3. How can i hide running application?
    By roodiii in forum Operating Systems
    Replies: 5
    Last Post: 08-01-2010, 08:53 PM
  4. Excel - Select Switch Command keeps running
    By wuuhaahaa in forum Windows Software
    Replies: 1
    Last Post: 22-10-2009, 11:31 PM
  5. Running multiple instances of an application
    By DocAtom in forum Vista Help
    Replies: 7
    Last Post: 14-02-2008, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,140,746.39051 seconds with 16 queries