+ Reply to Thread
Results 1 to 8 of 8

textbox that forces user to name workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    10-28-2014
    Location
    ottawa, ontario, canada
    MS-Off Ver
    excel, outlook 2010
    Posts
    18

    textbox that forces user to name workbook

    I've been struggling with this for a few days. I want the workboook to open with an inputbox that forces the users to name the workbook automatically. Been running into errors left and right however!.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: textbox that forces user to name workbook

    When you say "name the workbook", do you mean save the workbook with a different filename?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-28-2014
    Location
    ottawa, ontario, canada
    MS-Off Ver
    excel, outlook 2010
    Posts
    18

    Re: textbox that forces user to name workbook

    when they open the workbook, which is a template. I want them forced to name the workbook, so yes like a "saved as" type solution

  4. #4
    Registered User
    Join Date
    10-28-2014
    Location
    ottawa, ontario, canada
    MS-Off Ver
    excel, outlook 2010
    Posts
    18

    Re: textbox that forces user to name workbook

    NEW TSR TEMPLATE.xlsmnew tsr summary.xls

    This is my project. It is a TSR (training resource request) which allows people to request supplies for training like fresh food, ammo, transport etc. I want it to populate the TRACKER as automatically as possible.


    I would like people using a request to be forced to name it differently then other people and have the status of each item on the TSR should its status on the tracker.

    This seems pretty clear to me but I have seen alot of these so I'm probably taking alot of things for granted. If you need any more explanation let me know. I'm kinda stuck here

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: textbox that forces user to name workbook

    Save your "template" file as a Macro Enabled Template (.xltm) file, and put something like this in the workbook module:

    Private Sub Workbook_Open()
        Dim sFile As String, s As String, wb As Workbook
        Set wb = ThisWorkbook
        If wb.FileFormat <> 53 Then Exit Sub
        s = wb.Name
        sFile = Application.GetSaveAsFilename(InitialFileName:="Copy of " & Left(s, Len(s) - 5), FileFilter:="Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
        If Not sFile = "False" Then
            With Application
                .DisplayAlerts = False
                ThisWorkbook.SaveAs Filename:=sFile, FileFormat:=52
                .DisplayAlerts = True
            End With
        Else
            wb.Close (False)
        End If
    End Sub

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: textbox that forces user to name workbook

    Read carefully:

    Quote Originally Posted by Olly View Post
    Save your "template" file as a Macro Enabled Template (.xltm) file
    the code checks the file type - if it is a XLTM (macro enabled template) then it will prompt the user to save as a regular macro enabled workbook, with a new name. If they cancel that operation, the file closes.

  7. #7
    Registered User
    Join Date
    10-28-2014
    Location
    ottawa, ontario, canada
    MS-Off Ver
    excel, outlook 2010
    Posts
    18

    Re: textbox that forces user to name workbook

    It was already a macro enabled worksheet at least it is on my computer.

    That code did'nt seem to do anything for me

  8. #8
    Registered User
    Join Date
    10-28-2014
    Location
    ottawa, ontario, canada
    MS-Off Ver
    excel, outlook 2010
    Posts
    18

    Re: textbox that forces user to name workbook

    okay so that works fine. Now how would you recomend I go about populating the tracker with the information from that?

    keep in mind the listings on the tracker (dukes, bravo, charles,echo and fox) are going to have multiple entries in them.


    the way it works is that lets say Bravo company submitted a TSR named Ghost walker.

    the name "ghost walker" would go into the reference number section and then the sections of the TSR (ammo, tgt req, FSR etc) get tracked according to when they are individually approved. I made them color coded but I'm not sure how I would be able to automatically populate this thing its driving me nuts.

+ 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. vba excel user form restrict input on user textbox
    By samz93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 04:38 PM
  2. Conditional Formatting Forces Ugly Font
    By Alcon in forum Excel General
    Replies: 4
    Last Post: 03-02-2012, 04:40 PM
  3. Adding a header forces new page
    By mealstrom in forum Excel General
    Replies: 10
    Last Post: 04-01-2011, 01:08 PM
  4. Macro that forces user to save file on open
    By dmars in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2009, 04:46 PM
  5. Drop Down forces calculate
    By demuro1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-12-2008, 06:18 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