+ Reply to Thread
Results 1 to 3 of 3

[SOLVED] Save as new file command button

  1. #1
    EnGo
    Guest

    [SOLVED] Save as new file command button

    I am trying to create a macro with a command button that will save the
    worksheet as a file name specified by the user name or as a field title in
    the spreadsheet.
    Here is what I have right now that I keep getting a error with:
    Private Sub SaveButton_Click()

    ActiveWorkbook.SaveAs Filename:= _
    "C:\Documents and Settings\MYoung\Desktop\h&h VALVE\" &
    Range("Company:"), _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False
    End Sub

    If someone could please help with with this error and coding problem.


  2. #2
    N10
    Guest

    Re: Save as new file command button


    "EnGo" <EnGo@discussions.microsoft.com> wrote in message
    news:08CA9CDC-B956-4B9D-8B65-5C6D8C4D91B2@microsoft.com...
    >I am trying to create a macro with a command button that will save the
    > worksheet as a file name specified by the user name or as a field title in
    > the spreadsheet.
    > Here is what I have right now that I keep getting a error with:
    > Private Sub SaveButton_Click()
    >
    > ActiveWorkbook.SaveAs Filename:= _
    > "C:\Documents and Settings\MYoung\Desktop\h&h VALVE\" &
    > Range("Company:"), _
    > FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    > ReadOnlyRecommended:=False, CreateBackup:=False
    > End Sub
    >
    > If someone could please help with with this error and coding problem.
    >



    Does your named range end with a : as in Range("Company:") ? or should it
    be Range("Company"),



  3. #3
    EnGo
    Guest

    Re: Save as new file command button

    N10: It ends with a colon(, does that pose a problem. I can remove the
    colons from the tables if so.

    "N10" wrote:

    >
    > "EnGo" <EnGo@discussions.microsoft.com> wrote in message
    > news:08CA9CDC-B956-4B9D-8B65-5C6D8C4D91B2@microsoft.com...
    > >I am trying to create a macro with a command button that will save the
    > > worksheet as a file name specified by the user name or as a field title in
    > > the spreadsheet.
    > > Here is what I have right now that I keep getting a error with:
    > > Private Sub SaveButton_Click()
    > >
    > > ActiveWorkbook.SaveAs Filename:= _
    > > "C:\Documents and Settings\MYoung\Desktop\h&h VALVE\" &
    > > Range("Company:"), _
    > > FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    > > ReadOnlyRecommended:=False, CreateBackup:=False
    > > End Sub
    > >
    > > If someone could please help with with this error and coding problem.
    > >

    >
    >
    > Does your named range end with a : as in Range("Company:") ? or should it
    > be Range("Company"),
    >
    >
    >


+ 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