using excel from dotnet

  • Thread starter Thread starter mp
  • Start date Start date
M

mp

situation:
I'm 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
 
Thank you! I wasn't 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
 
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 don't need installed on
user machines, just the developer machine?

thanks
mark
 
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
 
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 don't have vis stu, just express
am i hosed?
is .net command prompt different from regular windows command prompt?

thanks
mark
 
mp,

search for gacutil file on your PC, then update the path to this utility and
run register.bat from the extracted folder
 
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.
 
hmmm, thought I replied the other day but i don't 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're
saying i can run gacutil just from a regular command window?

Sergey Poberezovskiy said:
mp,

search for gacutil file on your PC,

then update the path to this utility

do you mean change the environment Path to include that folder?
i think so
run register.bat from the extracted folder

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
 
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 wasn't 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
 
mp said:
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 wasn't there at the end of the list

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 Morton said:
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"
Thanks, I figured out the semicolon part when i noticed my path is now
screwed up.(missing ";" )
I'm looking for a windows way to change path so i don't have to retype whole
thing at command prompt but haven't 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 doesn't return
the same path as the Path variable does - not even close - so dont' know
where that advice came from (on wiki i think)
 
Back
Top