Re: Excel bis Excel 2000 ansprechen Ergänzung

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hallo Frank,

das mit dem einklinken in die laufende Instanz klappt nun.
Aber:
Wenn ich nun meine excel file öffne das bereits geöffnet ist wird der anwender gefragt ob er das bisherigen verwerfen will.

this.oWB = (Excel._Workbook)(this.oXL.Workbooks.Open(this.XlsPath, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value));

Wie kann ich das denn unterdrücken?

"Frank Dzaebel" <tcnt.Dzaebel@xxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag news:d5108bcd-d880-4b72-8e3c-d74fd3ee6e06@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hallo Michael,

ich sach nur es lebe Virtual PC ;-) Danke

;-)



Nun bin ich noch auf der Suche nach:
Die intallierte Excel version ermiiteln am besten ohne
this.oXL = new Excel.Application();
Weil dazu wird sie ja gleich gestartet.
Wie gehts ohne Start?

das geht auch über die RegistryKey's, etwa:

RegistryKey officeKey = Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\Microsoft\Office\10.0\Common\InstallRoot", false);
string path = officeKey.GetValue("Path") as string;

wenn der existiert ist halt Office 10 installiert und analog.



2.) Wie klinkt man sich eine laufende Instanz ein?
Alles wie gesagt erst ab Excel 2003 ;-)

geht mit GetActiveObject("Excel.Application").
Also etwa so:

object activeApp=null;
try
{
activeApp = Marshal.GetActiveObject("Excel.Application");
}
catch { }
MessageBox.Show("Excel aktiv: " + (activeApp != null));


Mitunter sind bei COM-Servern allgemein Dinge wie hier zu beachten:

[Laufende Visual Studio Instanz filtern]
http://dzaebel.net/VsInstanz.htm


ciao Frank
--
Dipl.Inf. Frank Dzaebel [MCP/MVP C#]
http://Dzaebel.NET

.



Relevant Pages

  • Re: Frank Kabel: A Sad Day for the Excel Community
    ... My deepest sympathies to Frank's family. ... Frank you will forever be remebered by your Excel ... > family and friends. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Frank Kabel: A Sad Day for the Excel Community
    ... My deepest sympathies to Frank's family. ... Frank you will forever be remebered by your Excel ... > family and friends. ...
    (microsoft.public.excel.programming)
  • Re: Frank Kabel: A Sad Day for the Excel Community
    ... My deepest sympathies to Frank's family. ... Frank you will forever be remebered by your Excel ... > family and friends. ...
    (microsoft.public.excel.misc)
  • Re: timeformatting and colored cells
    ... > Frank, I really appreciate your effort to help me, now it works!! ... >> you can't invoke this macro with the macro dialog. ... >> defined function which can be used like a normal Excel formula (e.g. ... there is a need of if I color any of these cells in Color2 ...
    (microsoft.public.excel.programming)
  • RE: Frank Kabel: A Sad Day for the Excel Community
    ... > Frank was not only a very major contributor to these newsgroups but he ... > was also a great innovative developer and friend to all. ... > was our newest MVP Excel and he achieved this recognition at the same ... > We offer condolences to his family and friends at the loss of Frank at ...
    (microsoft.public.excel.programming)