ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Help Please (https://www.excelbanter.com/excel-programming/305361-need-help-please.html)

sbriscoe[_2_]

Need Help Please
 
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

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_7_]

Need Help Please
 
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?

--
HTH

-------

Bob Phillips
"sbriscoe " wrote in message
...
Hi Everyone
I am having a problem getting my CommandBar code working when there is
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 New
buttons on the toolbar).

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

Is there anyway to fix this?

Thanks so much in advance.
Stacie


---
Message posted from http://www.ExcelForum.com/




sbriscoe[_3_]

Need Help Please
 
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)

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_7_]

Need Help Please
 
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" wrote in message
...
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?

--
HTH

-------

Bob Phillips
"sbriscoe " wrote in message
...
Hi Everyone
I am having a problem getting my CommandBar code working when there is
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 New
buttons on the toolbar).

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

Is there anyway to fix this?

Thanks so much in advance.
Stacie


---
Message posted from http://www.ExcelForum.com/






sbriscoe[_6_]

Need Help Please
 
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?

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com