Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tool/Command Bars Do Not Display

Status
Not open for further replies.

mamartin

Programmer
Aug 10, 2001
75
0
0
US
I am creating a VB6.0 application that selects some data and then writes it to an Excel 2000 file. When I call up Excel from within the VB app, the Standard and Formatting command bars do not display. This is what the code looks like:

Dim xlApplicationObject As Excel.Application
Dim xlWorkBookObject As Excel.Workbook
Dim xlWorkSheetObject As Excel.Worksheet

Set xlApplicationObject = CreateObject("Excel.Application")
Set xlWorkBookObject = xlApplicationObject.Workbooks.Add
Set xlWorkSheetObject = xlWorkBookObject.ActiveSheet

xlApplicationObject.CommandBars("standard").Enabled = True
xlApplicationObject.CommandBars("formatting").Enabled = True
xlApplicationObject.CommandBars("Standard").Visible = True
xlApplicationObject.CommandBars("Formatting").Visible = True

When Excel is invoked, it comes up, data is written to the proper cells, but no bars. Any ideas?
 
Any luck?

I can't account for the behavior your reporting nor duplicate it. I do have a question, though: Where do you make the Excel instance visible? The default is for the app to not be visible.


Regards,
Mike
 
That was the problem. I had not made the Excel instance visible, even though Excel was displaying and the VB app was writing data to the cells. Once I added "xlApplicationObject.Visible = True", it worked. Thanks.
 
Glad you got it working. Sometimes, it's the most innocuous things! [wink]


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top