Link to home
Start Free TrialLog in
Avatar of GlobaLevel
GlobaLevelFlag for United States of America

asked on

VBA - create new workbook and make it invisable

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

ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial