VBA - create new workbook and make it invisable

GlobaLevel
GlobaLevel used Ask the Experts™
on
I have tried all these statements, and I cant seem to make the new workbook that i just created invisable.....

'MAKE INVISABLE
        newXl.visable = False
            Application.Windows("dcCopyBefore.csv").Visible = True
        Set wbk = Workbooks.Open("C:\disputedChangesRpts\dcCopyBefore.csv")
       Windows(wbk.Name).Visible = False
        Windows("dcCopyBefore.csv").Visible = False
        Worksheets("dcCopyBefore").visable = False
On Error GoTo ErrCatcher
  
Dim newXl As Object
Dim wbk As Workbook
Dim ws As Worksheet
Dim strCopy As String
Dim csvPath As String
Dim dcCopyBefore As String


dcCopyBefore = "dcCopyBefore.csv"
  
'Create a directoriy to save new copy of CB Data to
MyPath = "C:\disputedChangesRpts"
If Dir$(MyPath, vbDirectory) = "" Then MkDir MyPath
    
Set newXl = Workbooks.Add
    With newXl
        .Title = "dcCopyBefore"
        .Subject = "dcCopyBefore"
        .SaveAs Filename:="dcCopyBefore.csv"
    End With

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this....

    newXL.Windows(1).Visible = False

Wayne
TracyVBA Developer
Commented:
Just remember to turn it back on my setting it to True at the end.

newXL.Windows(1).Visible = True

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial