Results 1 to 9 of 9

VBA Code to save new file without LINKS

Threaded View

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    Philadelphia PA
    MS-Off Ver
    Excel 2010
    Posts
    12

    VBA Code to save new file without LINKS

    Hello All. I am new to Excel Forum and VBA. I managed to create an Excel 2010 macro enabled user form and via VBA code saves the form as a normal Excel Worksheet (xlsx) with a new file name. My problem is that when the new file is opened it is still linked. I figured out how to manually break the link and disable macro notice but this is after the new file has been created, and would have to be done manually for every file saved. Is there a VBA code I can add that will do this before saving the new file.

    This is the code I am using to save the new file:

    [code]

    Sub SaveInvWithNewName()
    Dim NewFN As Variant
    ' Copy Invoice to a new workbook
    ActiveSheet.Shapes.Range(Array("Bevel 2")).Delete
    ActiveSheet.Shapes.Range(Array("Bevel 3")).Delete
    ActiveSheet.Copy
    NewFN = "C:\XXXXX\" & Range("I4").Value & ".xlsx"
    ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
    ActiveWorkbook.Close
    NextInvoice
    End Sub

    [code]
    Last edited by CharleneM; 04-19-2013 at 04:47 PM.

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