.NET Framework - using excel from dotnet
Asked By mp
08-Feb-10 06:30 PM
situation:
I am working on a new app in vbexpress 2008 using acad com interop
Also need to write extracted data to excel.
problem:
At home(laptop) i have excel 10. At the office excel 12.
(both seem to have excel5 listed in refs.)
I need to work at both locations.
can i reference both 10 and 12 in the same vbproj (i think not)
can i just reference 5 and is that just an older version with common (but
not the latest) interface?
i guess i can just have 2 vbproj files (one on laptop one at work) and just
copy the .vb class files that are being edited back and forth, not copy the
vbproj file back and forth?
I think the dotnet project is dynamic(using actual disk copy of files when
opened) - as opposed to vba which copies the disk file contents into the dvb
and then the disk files are not updated when the modules in the dvb are
edited unless you do a manual export? so i think just updating the .vb files
should work fine?
any tips?
thanks
mark
Office
(1)
Excel
(1)
XP
(1)
Path
(1)
Check
(1)
PIAs
(1)
WrongI
(1)
Vbproj
(1)
Sergey Poberezovskiy replied to mp
You should use XP PIAs:
http://support.microsoft.com/kb/328912
and reference them from your project - this way your application will run
just fine on any PC that has XP or later Office
Hope this helps
mp replied to Sergey Poberezovskiy
Thank you! I was not aware of those.
I see two options oxppia.exe
and
PrimaryInteropAssembly.exe
description sounds similar except one says redistributable and appears to
have installation instructions.
Do you know the difference? how to decide which to use?
mark
mp replied to Sergey Poberezovskiy
I will try the PrimaryInteropAssembly.exe
Is there a best use practice for where to install them? Windows\System32 ?
I presume if they are compiled into a net dll they do not need installed on
user machines, just the developer machine?
thanks
mark
mp replied to mp
Tried to install o2007pia.msi (double clicked)
i get the following error dialog:
Error 1316. Setup cannot read from the file (path to msi)\PiaRedist.msi.
Check your connection to the network, or Cd-rom drive. For other potential
solutions to this problem, see Setup.chm
there is no Setup.chm or PiaRedist.msi in the downloaded exe
anyone know about this one?
thnaks
mark
mp replied to mp
ok, abandoned that one
tried the other one and it looks more hopefull
it extracted a large number of interop dlls
installation instructions in Readme.htm say to use vis studio tools| vis stu
.net command prompt
i do not have vis stu, just express
am i hosed?
is .net command prompt different from regular windows command prompt?
thanks
mark
Sergey Poberezovskiy replied to mp
mp,
search for gacutil file on your PC, then update the path to this utility and
run register.bat from the extracted folder
mp replied to Sergey Poberezovskiy
I was thinking to maybe just install the excel interop (3 or 4 files) rather
than register.bat which installs all as far as i could tell from the readme.
mp replied to Sergey Poberezovskiy
hmmm, thought I replied the other day but i do not see it.
I was thinking of just installing the ones for excel, rather than all of
them, which i think the register bat is for.
need to study the install instructions some more, but it looks like you are
saying i can run gacutil just from a regular command window?
then update the path to this utility
do you mean change the environment Path to include that folder?
i think so
so then i cd to the extracted folder and since i added the gacutil path to
env i can run from this folder
i think i get it
snip
mp replied to Sergey Poberezovskiy
ok, i'm not much of a dos guy so not sure what i did wrong
I went into command prompt to add the path to gacutil to the path env var.
at command prompt i entered
Path %Path% C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
according to the help that should have appended the 'PathToGacUtil' to the
existing path
at the time it returned the whole list with it appended, but the next time i
ran Path, it was not there at the end of the list
???
when i cd to the extracted folder and enter
gacutil -i Microsoft.Office.Interop.Excel.dll
i get gacutil not recognized...etc
then i check Path and the folder(to gacutil) is not there anymore
Andrew Morton replied to mp
You need a semi-colon in there for the path separator and quotes around the
path because it has spaces in it:
Path %Path%;"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin"
--
Andrew
mp replied to Andrew Morton
Thanks, I figured out the semicolon part when i noticed my path is now
screwed up.(missing ";" )
I am looking for a windows way to change path so i do not have to retype whole
thing at command prompt but have not found one (i'm afraid i'll do typo and
make it even worse)
I saw a reference to doing it through control panel but that does not return
the same path as the Path variable does - not even close - so dont' know
where that advice came from (on wiki i think)
VSTO2005 - Does it support Office 2007? .NET Framework WaterObjects.NET.IDSE XP / Office 2003 Vista / Office 2003 XP / Office 2007 Vista / Office 2007 VSTO 2003 Built (.Net 1.1 dependency) Works Works Message about not being able to initialize correctly. Works VSTO 2005 Built (.Net 2.0 dependency) Works* Works* Takes down Excel hard. RTE when opening model, otherwise works. Not sure how the above table will come
Excel bis Excel 2000 ansprechen .NET Framework Hallo zusammen, ich sollte wenn möglich alle Excel versionen bis runter zur 2000 ansprechen. mit: using Excel = Microsoft.Office.Interop.Excel; Was muss ich denn nun tun damit nicht nur die läuft die ich grad auf Pia's downloaden? Und ins Projekt referenzieren? Danke und Gruss Michael C# - German Discussions Microsoft.Office.Interop.Excel.WorkbookClass (1) Microsoft.Office.Interop.Excel (1) Virtual PC (1) Office XP (1) Visual Studio
EXCEL 2007 INSTALLATION .NET Framework Hello: I am a previous Excel XP user. I installed Excel 2007 but all personalized features I used in XP were brought to the 2007 edition. The problem is: I want to install Excel 2007 clean, with the default parameters as it come from the manufacturer. How can I do That. .NET Discussions Excel 2007 (1) Office (1) Excel (1) XP (1) Elitor (1) If you ask in a discussion group for
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 .NET Framework Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel 2003 application (Reports) works ok. But when Office 2003 is
Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine .NET Framework I'm writing a C# app which will populate an Excel spreadsheet. The app references Excel using COM. I have Office 2007 on my machine, but the machine which will be running the application will have Office 2003. Therefore, when I added the Excel COM reference, I chose the Excel 11 one. Now that I'm trying the application on another machine I'm getting