Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: delete temp files Pin
Heath Stewart23-Mar-04 3:57
protectorHeath Stewart23-Mar-04 3:57 
GeneralRe: delete temp files Pin
Dave Kreskowiak23-Mar-04 4:29
mveDave Kreskowiak23-Mar-04 4:29 
GeneralRe: delete temp files Pin
Heath Stewart23-Mar-04 4:50
protectorHeath Stewart23-Mar-04 4:50 
GeneralRe: delete temp files Pin
Dave Kreskowiak23-Mar-04 5:20
mveDave Kreskowiak23-Mar-04 5:20 
GeneralRe: delete temp files Pin
Heath Stewart23-Mar-04 5:22
protectorHeath Stewart23-Mar-04 5:22 
GeneralRe: delete temp files Pin
Dave Kreskowiak23-Mar-04 5:29
mveDave Kreskowiak23-Mar-04 5:29 
GeneralC# Excel Sheet Reading Problems Pin
MeMyselfAndDotNet22-Mar-04 20:42
MeMyselfAndDotNet22-Mar-04 20:42 
GeneralRe: C# Excel Sheet Reading Problems Pin
Heath Stewart23-Mar-04 4:04
protectorHeath Stewart23-Mar-04 4:04 
You'll have to use the Microsoft Office PIAs (Primary Interop Assemblies). If you are using Office 2002 (XP), you can download them from http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en[^]. If you're using Office 2003 Professional or Developer you can get these from the CD. They are not downloadable unless you're an MSDN Subscriber, though. In that case, however, you can actually use the XP PIAs because the supported interfaces are backwards compatible, at least for the functionality you need.

In your code, create a new instance of the ApplicationClass and use ApplicationClass.Workbooks.Open to open your file. You can then enumerate the Sheets property to get the name. Make sure to close the workbook and call ApplicationClass.Quit when done. If you design an effective caching system, you could save yourself a big performance hit by remembering which files have which worksheets if you know they won't change.

 

Microsoft MVP, Visual C#
My Articles
GeneralGetting the exe path Pin
SatyaDY22-Mar-04 20:08
SatyaDY22-Mar-04 20:08 
GeneralRe: Getting the exe path Pin
partyganger22-Mar-04 20:24
partyganger22-Mar-04 20:24 
GeneralRe: Getting the exe path Pin
SatyaDY22-Mar-04 21:03
SatyaDY22-Mar-04 21:03 
GeneralRe: Getting the exe path Pin
hazzem elrefai22-Mar-04 21:09
hazzem elrefai22-Mar-04 21:09 
GeneralRe: Getting the exe path Pin
SatyaDY22-Mar-04 21:41
SatyaDY22-Mar-04 21:41 
GeneralRe: Getting the exe path Pin
Dave Kreskowiak23-Mar-04 1:58
mveDave Kreskowiak23-Mar-04 1:58 
GeneralRe: Getting the exe path Pin
Heath Stewart23-Mar-04 4:15
protectorHeath Stewart23-Mar-04 4:15 
GeneralRe: Getting the exe path Pin
Sascha Andres25-Mar-04 11:02
Sascha Andres25-Mar-04 11:02 
GeneralUser control automatically resized when the parent form is sized in C# Pin
jayakarthikeyan22-Mar-04 18:42
jayakarthikeyan22-Mar-04 18:42 
GeneralRe: User control automatically resized when the parent form is sized in C# Pin
Dave Kreskowiak23-Mar-04 1:59
mveDave Kreskowiak23-Mar-04 1:59 
GeneralRe: User control automatically resized when the parent form is sized in C# Pin
jayakarthikeyan23-Mar-04 3:31
jayakarthikeyan23-Mar-04 3:31 
GeneralRe: User control automatically resized when the parent form is sized in C# Pin
Dave Kreskowiak23-Mar-04 3:55
mveDave Kreskowiak23-Mar-04 3:55 
GeneralRe: User control automatically resized when the parent form is sized in C# Pin
jayakarthikeyan26-Mar-04 2:45
jayakarthikeyan26-Mar-04 2:45 
GeneralRe: User control automatically resized when the parent form is sized in C# Pin
Heath Stewart23-Mar-04 4:17
protectorHeath Stewart23-Mar-04 4:17 
GeneralChoosing The Right Design Pattern Pin
sixefftee22-Mar-04 18:14
sixefftee22-Mar-04 18:14 
Questionaccess to Win32Native class? Pin
Ray Gregory22-Mar-04 15:48
Ray Gregory22-Mar-04 15:48 
AnswerRe: access to Win32Native class? Pin
Nick Parker22-Mar-04 17:17
protectorNick Parker22-Mar-04 17:17 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.