Results 1 to 4 of 4

Saving file using wildcard

Threaded View

  1. #1
    Registered User
    Join Date
    12-07-2012
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    17

    Saving file using wildcard

    I can get the file to save to a directory I specify, but it looks as though I need to save the workbook to a more specific and variable folder. The book gets saved to a customer folder. That part I've got down, as well as naming the workbook, but I need to the path to go to a more specific file within the customer folder that always changes depending on the part number. The first 2-4 characters change and the remaining characters are x's. All parts with those matching first 2-4 characters are in that specified folder. I'm having trouble using the wildcard function to specify the sub folder inside the customer's folder.

    Sub Save_Click()
    Dim Customer As String
    Dim PartN As String
    Dim ExternalLinks As Variant
    Dim wb As Workbook
    Dim x As Long
    
    
    Customer = Range("D4").Value
    
    
    
    'Save the new workbook
    ChDir "T:\Master Print and Inspection Report Files\" & Customer & "\" & "Inspection Reports" & "\"
    ActiveWorkbook.SaveAs Filename:= _
    "T:\Master Print and Inspection Report Files\" & Customer & "\" & "Inspection Reports" & "\" & Range("D5") & " REV " & Range("G5") & " AS & INSP" & ".xlsm", _
    FileFormat:=52, CreateBackup:=False
    
    
    
    Set wb = ActiveWorkbook
    
    'Create an Array of all External Links stored in Workbook
      ExternalLinks = wb.LinkSources(Type:=xlLinkTypeExcelLinks)
    
    'Loop Through each External Link in ActiveWorkbook and Break it
      For x = 1 To UBound(ExternalLinks)
        wb.BreakLink Name:=ExternalLinks(x), Type:=xlLinkTypeExcelLinks
      Next x
    
        
    End Sub
    Last edited by Jhansen5452; 12-15-2015 at 05:29 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 08-23-2014, 01:28 PM
  2. Need to get the name of the File in a Vlookup VBA using wildcard characters
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-24-2014, 02:34 PM
  3. Wildcard not working when i download single file from FTP server with .bat file
    By brently in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2013, 05:54 PM
  4. Batch to Copy with wildcard in file name
    By ashokunbi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 09:57 AM
  5. Wildcard macro to move file
    By dave1983 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-22-2013, 06:35 AM
  6. Creating a .txt file extracting information from a Excel file saving as .resx file
    By AbdallahHajbed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2012, 09:00 AM
  7. Possible to identify the name of the file that was opened using a wildcard?
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2008, 06:22 PM

Tags for this Thread

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