SaveAs and Hidden Workbooks

G

Guest

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
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top