Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default SaveAs and Hidden Workbooks

When I use the save as command to create a new file,
How do I set the attributes to hidden?
So the Workbook does not show up in the explorer window.

Workbooks.Open Filename:= _
"C:\Documents and Settings\All Users\Documents\" & _
"OFFICE SKILLS\Invoice_AND_Total_Sheet.xls "

Workbooks("Invoice_AND_Total_Sheet.xls").SaveAs _
FolderNme & _
"\" & "Invoice_AND_Total_Sheet.xls"
Workbooks("Invoice_AND_Total_Sheet.xls").Close
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default SaveAs and Hidden Workbooks

Take a look at the SetAttr command in VBA's help:

dim myfilename as string
myfilename = FolderNme & "\" & "Invoice_AND_Total_Sheet.xls"
'open, save, close
SetAttr myfilename, vbHidden

But if you're only opening it to save it to a different location, take a look at
FileCopy in VBA's help.

You could just copy it to the new location.

===
Just an aside: I show all files in windows explorer--including hidden. So this
technique may not be 100% effective.




wtpcomplab wrote:

When I use the save as command to create a new file,
How do I set the attributes to hidden?
So the Workbook does not show up in the explorer window.

Workbooks.Open Filename:= _
"C:\Documents and Settings\All Users\Documents\" & _
"OFFICE SKILLS\Invoice_AND_Total_Sheet.xls "

Workbooks("Invoice_AND_Total_Sheet.xls").SaveAs _
FolderNme & _
"\" & "Invoice_AND_Total_Sheet.xls"
Workbooks("Invoice_AND_Total_Sheet.xls").Close


--

Dave Peterson
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
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Hidden Columns in Shared Workbooks Rotary Excel Discussion (Misc queries) 1 July 9th 05 12:28 AM
Hidden Columns in Shared Workbooks Rotary Setting up and Configuration of Excel 0 July 8th 05 06:05 PM
References to open/hidden workbooks become hard-coded in formulas - 2003 L Mehl Excel Discussion (Misc queries) 2 November 27th 04 09:28 PM
References to open/hidden workbooks become hard-coded in formulas- 2003 Larry Mehl Excel Programming 1 November 27th 04 11:15 AM


All times are GMT +1. The time now is 11:37 PM.

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"