+ Reply to Thread
Results 1 to 2 of 2

Save As Function

  1. #1
    Hlewis
    Guest

    Save As Function

    I am trying to create code that will save a workbook based on a date in a
    cell on a sheet within the workbook. I have started the code but VB doesn't
    like it. See below:
    ActiveWorkbook.Save
    Sheets("Schedule").Select
    ActiveWorkbook.SaveAs Filename:= _
    "T:\Period End Schedules\Inventory Account Schedules\Inventory
    Obsolescence\Schedule\" & Month("A2") & "/" & Day("A2") & "/" & Year("A2") &
    ".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="Password", _
    ReadOnlyRecommended:=False, CreateBackup:=True

    End Sub

    The problem I am having is that the code bombs at the SaveAs command. How
    do I get around this?
    --
    Hlewis

  2. #2
    Helmut Weber
    Guest

    Re: Save As Function

    Hi,

    a slash "/" is not a valid character in a filename.

    --
    Greetings from Bavaria, Germany

    Helmut Weber, MVP WordVBA

    Win XP, Office 2003
    "red.sys" & Chr$(64) & "t-online.de"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1