View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
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