Need Help Please

S

sbriscoe

Hi Everyone
I am having a problem getting my CommandBar code working when there i
already an Excel Application running.

When I run my program and there are no other Excel processes running
my Tool Bar changes display properly (I am hiding the Save and Ne
buttons on the toolbar).

But - when I already have an Excel application up, then when I run th
application - it looks like it is using the Tool Bar from the existin
Excel and my Save and New buttons reappear

Is there anyway to fix this?

Thanks so much in advance.
Staci
 
B

Bob Phillips

Don't think so. Why don't you re-use the same Excel instance, and raise your
toolbar when your workbook opens and reset afterwards?
 
S

sbriscoe

Can you give an example of what you mean by using the same instance?
am writing in C#.

Wouldnt that affect the toolbar of both Excel's then? (which I don
want to do - I only want the excel in my application to have th
toolbar changes)
 
B

Bob Phillips

In C# I have no idea I am afraid, but it VBA you would use GetObject to see
if app is already there, otherwise CreateObject it.

--
HTH

-------

Bob Phillips
Bob Phillips said:
Don't think so. Why don't you re-use the same Excel instance, and raise your
toolbar when your workbook opens and reset afterwards?
 
S

sbriscoe

Thanks for your help :)

Right now I am using:

ExcelApp = new Excel.Application();

Which is creating a new object.

I will have to see about a GetObject() call in C#...

anyone out there have any idea?
 
Top