Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Saving a sheet as unhidden in VB

I am writing an application in Visual Basic 6.0 that creates an Excel sheet
object, writes to it, and then saves the Excel file. When I load the file
in Excel, the workbook is hidden. I have to select Window-Unhide to unhide
it. Does anyone know how I can save the sheet as "unhidden?"

Thanks,
Barry Sommerfeld



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Saving a sheet as unhidden in VB

There is a microsoft Knowledgebase article describing
this. I know because I saw it today but can't find it
anymore.
The basic gist of the article was that this occurs when
you use the getobject command and save it using the saveas
command. to correct this you must make the object visible.

if you want to use the getobject and saveas commands
consider the following

dim oexcel as object
dim osheet as object
set oexcel = getobject(filename.xls)
set osheet = oexcel.worksheets(1)
oexcel.parent.windows(oexcel.name).visible = true
oexcel.saveas newfilename.xls
oexcel.close

your alternative is to create a new workbook
dim oexcel as object
dim obook as object
dim osheet as object
set oexcel = createobject("Excel.application")
set obook = oexcel.workbooks.add
set osheet = obook.worksheets(1)
obook.saveas newfilename.xls
oexcel.quit


-----Original Message-----
I am writing an application in Visual Basic 6.0 that

creates an Excel sheet
object, writes to it, and then saves the Excel file.

When I load the file
in Excel, the workbook is hidden. I have to select

Window-Unhide to unhide
it. Does anyone know how I can save the sheet

as "unhidden?"

Thanks,
Barry Sommerfeld



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a sheet as unhidden in VB

Barry I suggest you write a macro (in excel and the
workbook) that when you open the workbook it
outomatically unhides the workbook.
something like

Sheets("Sheet1").Visible = True
with the open workbook event

Johann

-----Original Message-----
I am writing an application in Visual Basic 6.0 that

creates an Excel sheet
object, writes to it, and then saves the Excel file.

When I load the file
in Excel, the workbook is hidden. I have to select

Window-Unhide to unhide
it. Does anyone know how I can save the sheet

as "unhidden?"

Thanks,
Barry Sommerfeld



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Saving a sheet as unhidden in VB

That worked. Thanks.

Barry Sommerfeld


"eli silverman" wrote in message
...
There is a microsoft Knowledgebase article describing
this. I know because I saw it today but can't find it
anymore.
The basic gist of the article was that this occurs when
you use the getobject command and save it using the saveas
command. to correct this you must make the object visible.

if you want to use the getobject and saveas commands
consider the following

dim oexcel as object
dim osheet as object
set oexcel = getobject(filename.xls)
set osheet = oexcel.worksheets(1)
oexcel.parent.windows(oexcel.name).visible = true
oexcel.saveas newfilename.xls
oexcel.close

your alternative is to create a new workbook
dim oexcel as object
dim obook as object
dim osheet as object
set oexcel = createobject("Excel.application")
set obook = oexcel.workbooks.add
set osheet = obook.worksheets(1)
obook.saveas newfilename.xls
oexcel.quit


-----Original Message-----
I am writing an application in Visual Basic 6.0 that

creates an Excel sheet
object, writes to it, and then saves the Excel file.

When I load the file
in Excel, the workbook is hidden. I have to select

Window-Unhide to unhide
it. Does anyone know how I can save the sheet

as "unhidden?"

Thanks,
Barry Sommerfeld



.



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
Saving sheet data to another sheet automatically John Aikin Excel Worksheet Functions 7 July 28th 09 09:40 PM
unhidden row only Nahc Excel Discussion (Misc queries) 3 February 22nd 08 02:36 PM
unhidden row Nahc New Users to Excel 2 February 22nd 08 01:36 PM
Saving cosmetic changes to the sheet townieflo Excel Discussion (Misc queries) 1 August 28th 07 03:31 PM
Excel- Saving only unhidden rows arich Excel Discussion (Misc queries) 2 June 22nd 05 02:54 PM


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

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

About Us

"It's about Microsoft Excel"