Results 1 to 40 of 54

Thread: Code to check if Workbook Exists

Threaded View

  1. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2010
    Posts
    272

    Re: Code to check if Workbook Exists

    I modified my code to:
    Code:
    Public Sub Monthly (varStar)
            On Error Resume Next
            Set WB = Workbooks.Open(Filename:="" & varStar)
            Call DoesWorkSheetExist       
            Run "RefreshOnOpen"
            With WB
                WB.SaveAs Filename:="" 
            End With
            WB.Close
            On Error GoTo 0
    End Sub
    I get a debug error of Argument not optional on the function posted here? Did I place it in the wrong place or leave out something?
    Last edited by Jo15765; Jan 16th, 2012 at 09:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width