Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make worksheet saved in VB6 visible?


A couple of years ago, when I did a GETOBJECT on an Excel Workbook fro

VB6, Excel would display while my program was operating on it.

Now I can't make Excel display while under a VB6 app program.

But, more importantly, when my VB6 app saves the workbook and I the
bring it up directly under Excel, the worksheets are hidden and I hav
to click "unhide" a couple of times to get the worksheets to b
visible.

I have tried MySheet.visible = true and that has no effect.

Thanks for kind advice. Lamon

--
Lamon
-----------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=502
View this thread: http://www.officehelp.in/showthread.php?t=125599

Posted from - http://www.officehelp.i

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to make worksheet saved in VB6 visible?

The worksheets (all but one) are hidden ?
Or the Workbook window is hidden ?

If you are working on the file from VB6 when it is hidden and then save it,
it will remain hidden when opened in Excel.

Depends what you VB6 code is doing......

NickHK

"Lamont" wrote in message
...

A couple of years ago, when I did a GETOBJECT on an Excel Workbook from

VB6, Excel would display while my program was operating on it.

Now I can't make Excel display while under a VB6 app program.

But, more importantly, when my VB6 app saves the workbook and I then
bring it up directly under Excel, the worksheets are hidden and I have
to click "unhide" a couple of times to get the worksheets to be
visible.

I have tried MySheet.visible = true and that has no effect.

Thanks for kind advice. Lamont


--
Lamont
------------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=5022
View this thread: http://www.officehelp.in/showthread.php?t=1255993

Posted from - http://www.officehelp.in



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make worksheet saved in VB6 visible?


Thank you for responding to my question "How to make worksheet saved i
VB6 visible?"

When I run Excel and then open the workbook just operated on by VB6
the title bar of the window says "Book1" and there is no data in th
spreadsheet.

Then on the toolbar I click Window | Unhide and a list box appear
showing my workbook.
I click that, and then the first worksheet appears, with the othe
worksheets tabs showing.

All these worksheets were in the workbook before VB6 operated on it.

As each worksheet is created, it is set to be visible.

Private InventoryBook As Excel.Workbook
Private SheetNoDups As Excel.Worksheet
...
Set InventoryBook = GetObject(....file specification for the workboo
....)
Set SheetNoDups = InventoryBook.worksheeets("ImageNot")
SheetNoDups.Visible = xlSheetVisible

After operations on the data, the program ends ...

InventoryBook.Save
InventoryBook.Close
Set InventoryBook = Nothing

The xlSheetVisible setting appears to have no affect.
Previously I was using SheetNoDups.Visible = True and that had n
effect.

Apparently the .Visible property works for VBA procs under Excel, bu
not in VB6 automation of Excel.

Thanks for kind consideration. Lamon

--
Lamon
-----------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=502
View this thread: http://www.officehelp.in/showthread.php?t=125599

Posted from - http://www.officehelp.i

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to make worksheet saved in VB6 visible?

Lamont,
There is a difference between the WS being visible and the window of the WB
being visible.
In your case, it sounds like the first is true but the latter is false.

If you record a macro whilst unhiding the window, you will get the code
needed to add to your VB6 code, before you .save the excel file.

NickHK

"Lamont" wrote in message
...

Thank you for responding to my question "How to make worksheet saved in
VB6 visible?"

When I run Excel and then open the workbook just operated on by VB6,
the title bar of the window says "Book1" and there is no data in the
spreadsheet.

Then on the toolbar I click Window | Unhide and a list box appears
showing my workbook.
I click that, and then the first worksheet appears, with the other
worksheets tabs showing.

All these worksheets were in the workbook before VB6 operated on it.

As each worksheet is created, it is set to be visible.

Private InventoryBook As Excel.Workbook
Private SheetNoDups As Excel.Worksheet
...
Set InventoryBook = GetObject(....file specification for the workbook
...)
Set SheetNoDups = InventoryBook.worksheeets("ImageNot")
SheetNoDups.Visible = xlSheetVisible

After operations on the data, the program ends ...

InventoryBook.Save
InventoryBook.Close
Set InventoryBook = Nothing

The xlSheetVisible setting appears to have no affect.
Previously I was using SheetNoDups.Visible = True and that had no
effect.

Apparently the .Visible property works for VBA procs under Excel, but
not in VB6 automation of Excel.

Thanks for kind consideration. Lamont


--
Lamont
------------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=5022
View this thread: http://www.officehelp.in/showthread.php?t=1255993

Posted from - http://www.officehelp.in



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make worksheet saved in VB6 visible?


Thanks, I smacked my forhead and said "I shoulda had a V8" when yo
reminded me about generating the code with the macro. But, I'm no
home yet. The macro generated a single line of code.

Windows("HomeStorageInventory.xls").Visible = True
I tried this line just after the Get Object statement with
variations(see below), and all fail on "subscript out of range."

strPathXLS = "C:\Documents and Settings\CQA\M
Documents\09AdminReference\AAHomeStorage\"
strXLSSpec = strPathXLS & "HomeStorageInventory.xls"
Set InventoryBook = GetObject(strXLSSpec)
'Windows(strXLSSpec).Visible = True 'Try with full file spe
fails
'Windows(InventoryBook.Name).Visible = True 'Try with symbo
fails
Windows("HomeStorageInventory.xls").Visible = True 'Try per X
macro fails

InventoryBook does not have a "Visible" property.
So, I'm stumped.

Best regards, Lamon

--
Lamon
-----------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=502
View this thread: http://www.officehelp.in/showthread.php?t=125599

Posted from - http://www.officehelp.i



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to make worksheet saved in VB6 visible?

How about
InventoryBook.Windows(1).Visible=true

NickHK

"Lamont" wrote in message
...

Thanks, I smacked my forhead and said "I shoulda had a V8" when you
reminded me about generating the code with the macro. But, I'm not
home yet. The macro generated a single line of code.

Windows("HomeStorageInventory.xls").Visible = True
I tried this line just after the Get Object statement with 3
variations(see below), and all fail on "subscript out of range."

strPathXLS = "C:\Documents and Settings\CQA\My
Documents\09AdminReference\AAHomeStorage\"
strXLSSpec = strPathXLS & "HomeStorageInventory.xls"
Set InventoryBook = GetObject(strXLSSpec)
'Windows(strXLSSpec).Visible = True 'Try with full file spec
fails
'Windows(InventoryBook.Name).Visible = True 'Try with symbol
fails
Windows("HomeStorageInventory.xls").Visible = True 'Try per XL
macro fails

InventoryBook does not have a "Visible" property.
So, I'm stumped.

Best regards, Lamont


--
Lamont
------------------------------------------------------------------------
Lamont's Profile: http://www.officehelp.in/member.php?userid=5022
View this thread: http://www.officehelp.in/showthread.php?t=1255993

Posted from - http://www.officehelp.in



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make a drop down box visible within a worksheet? skittles_golf Excel Worksheet Functions 42 April 21st 23 02:59 PM
I need to make MS word visible..please help Steven Excel Programming 4 October 19th 05 05:44 PM
Worksheet has to set to visible as it is not visible after saving and closing Excel by VB. Oscar Excel Programming 6 June 21st 05 10:39 PM
better search: "make worksheet visible" christo Excel Discussion (Misc queries) 1 December 1st 04 12:20 AM
How select all pictures in a worksheet and make visible? Gunnar Johansson Excel Programming 5 November 2nd 04 09:50 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"