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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing a newly created excel spreadsheet

Status
Not open for further replies.

jadedinvasion

Programmer
Feb 8, 2005
22
CA
Okay, this is a total newb question, but I'm hitting my head over this one. Just can't seem to get the right phrase to google...

In my vba module, I'm creating a new workbook which is all fine and dandy. Since vba creates the workbook in the back ground (for lack of a better term) it's not displayed on your screen.

What I was wondering is if there was some property to make the spreadsheet visible? I dont want to save this work book or print it, but I do need it to be visible to the user.

Any Ideas?
 
That's exactly what I'm doing, but it still doesn't show up.

Dim objExcelApp As Excel.Application
Dim objWb As Workbook

Set objExcelApp = CreateObject("Excel.application")
Set objWb = objExcelApp.Workbooks.Add

Could it be a system config thing?
 
No, that is NOT what you do and it's not a system config thing. Add this line of code ...

Code:
objExcelApp.Visible = True

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
If you are running your code in Excel VBA there is no need to create a new Excel object, firefytr is right, in the code you have setup you need the .visible = true. Your code is good is you are creating an Excel spreadsheet say in Access or Word VBA, but it's kinda overkill for Excel, where my simple 1 line of code would do for you what you are trying to do in 4 lines.

A,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top