Home |
Search |
Today's Posts |
#16
![]()
Posted to microsoft.public.vstudio.general,microsoft.public.dotnet.framework.interop,microsoft.public.dotnet.general,microsoft.public.office.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
If you're doing simple things you should be fine. That's what got me
started - all I wanted to do was send Outlook mail, and the late-binding to do all that has been around for years without PIAs. -- Phil Wilson "John Brock" wrote in message ... Very interesting!!! I knew about reflection and late binding, but it didn't occur to me that they could be used for this. (I assume this method will work just as well for VB.NET as for C#)? Yes, coding would be ugly. I would especially miss Intellisense. But it looks like doing it this way would remove all version worries. (I'm not doing anything especially sophisticated with Excel, so whatever I need is going to be there in all versions). In addition, I wouldn't even have to worry about whether any PIAs were installed on the end user's machine (which is not guaranteed). Have I understood all this correctly? In practice I think I would end up coding everything first using the Excel PIA, just to see what all the calls ended up looking like, and then translating everything to late binding. Yes, ugly, but maybe the best way. Thanks! In article , Wilson, Phil wrote: The general answer to this is to forget version-specific PIAs and use the late-binding scripting interfaces. It's pretty ugly, as you can see from this: http://support.microsoft.com/kb/302902 but it's been used for years by scripting clients. -- Phil Wilson "John Brock" wrote in message ... I want to use Visual Studio (2008, writing in VB.NET) to create an EXE file that will, among other things, read from and write to Excel workbooks. In particular, I want the program to work whether the machine has Office 2003 or Office 2007 installed. (Other versions of Excel would also be nice -- in particular 2010, when it comes out -- but those two are critical). I have no trouble accessing Excel 2007 on my own PC; however when I copy the EXE file to a PC with Office 2003 installed the program fails when it hits the Excel access code. (Note that VB.NET programs compiled on the other PC are able to read and write Excel 2003 files on that machine, so that's not the problem). I do know something about PIAs, although perhaps not enough. My project makes a COM reference to the Microsoft Excel 12.0 Office Library, which allows it to access Excel 2007. I believe that to access Excel 2003 I would need to reference the 11.0 library, which doesn't exist on my machine, so I can't reference it. Even if it did, I don't know if it's possible or would make sense to reference both libraries in the same project. So what do I do? My requirement seems very straightforward -- something that a lot of people would want to do. But I've looked around a bit without finding a way to do it. Indeed, I've found disturbing suggestions that I will need to compile a separate version of my program for each version of Office I want to be compatible with, which would be very unpleasant. (Just for starters, since you can't have two versions of Office on the same machine, I would need to get a second PC just for this!). I am really hoping that Microsoft has not made my life that difficult. So can anyone give me some advice, or point me to documentation that might help me out? -- John Brock -- John Brock |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How Do I Run An Executable from Excel? | Excel Programming | |||
Excel into executable | Excel Worksheet Functions | |||
Reference different versions of Access | Excel Programming | |||
Can't load Excel Executable | Setting up and Configuration of Excel | |||
Excel file as an executable? | Excel Programming |