+ Reply to Thread
Results 1 to 3 of 3

Save a Workbook with a different path and name (excel 2007)

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Brazil
    MS-Off Ver
    2007
    Posts
    10

    Save a Workbook with a different path and name (excel 2007)

    Hi!
    I need to save a workbook in a different path with a different name, based on some of the users inputs.

    To do so I used this code:

    Dim Name As String

    Name = Sheets("Form").Range("g7").Value & " - " & Sheets("Form").Range("c5").Value & "\" & Sheets("Form").Range("a1").Value & "_" & Sheets("Form").Range("g5").Value & "_" & Sheets("Form").Range("c7").Value & ".xlsx"

    ActiveSheet.SaveAs Filename:="\\acswpj3\dfs_ceng\Refri\privado\Pilar Segurança\2017\Rotas de Segurança\" & Name

    End Sub

    But I keep getting the "Application - defined or object - defined error"

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Save a Workbook with a different path and name (excel 2007)

    The path must exist and the filename must be legal. You should set the fileformat as well.

    e.g.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-14-2017
    Location
    Brazil
    MS-Off Ver
    2007
    Posts
    10

    Re: Save a Workbook with a different path and name (excel 2007)

    It worked!
    thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save workbook to speciifc path
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2015, 10:24 AM
  2. Save a Workbook With A file path and name referenced cell
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-19-2013, 06:39 AM
  3. [SOLVED] How to save a copy of the workbook to a specified path?
    By moxman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2013, 01:44 AM
  4. how can I add a path where to save the new workbook?
    By simeonmein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2013, 03:33 PM
  5. [SOLVED] Save a workbook to a folder path in textbox2 using textbox1 as filename
    By yoko21 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2013, 03:59 AM
  6. Path name invalid when trying to save a workbook - VBA
    By Jamiec94 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-17-2013, 12:42 PM
  7. Save Workbook using name and path in a cell
    By adinic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2007, 01:27 PM

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