+ Reply to Thread
Results 1 to 8 of 8

Create Excel Template shortcut on first open

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Create Excel Template shortcut on first open

    I have a macro which when SS is run first time on a coworker computer it installs two folders and creates a desktop shortcut of the folders and of the Excel workbook. This works fine if the SS is an XLSM, but if it is a template, XLTM when first opens it does the folder shortcuts well, but the SS shortcut is not correct. Is there a way to do this?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Create Excel Template shortcut on first open

    Not really, you'll need to save the template being blank, then put the shortcut to that. I think
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Excel Template shortcut on first open

    Perhaps your code needs to be updated to only create those folders and shortcuts after the workbook itself has been saved? This simple test on the ActiveWorkbook.FullName shows how to detect the existence of the .xlsm extension. Newly opened new workbooks don't have that until after you've saved it once. Can you adapt this?

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Create Excel Template shortcut on first open

    Quote Originally Posted by JBeaucaire View Post
    Perhaps your code needs to be updated to only create those folders and shortcuts after the workbook itself has been saved? This simple test on the ActiveWorkbook.FullName shows how to detect the existence of the .xlsm extension. Newly opened new workbooks don't have that until after you've saved it once. Can you adapt this?

    Please Login or Register  to view this content.
    Might be onto something? Do I put this in at the start of the sub which does the creating of folders, etc? Thanks.

  5. #5
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Create Excel Template shortcut on first open

    Tried it at the beginning of the sub and got an error in this line, MkDir "C:B620_signed", which I did not before adding your script. What I cannot figure out is when I open a regular Excel, the shortcut properties point to where the program originate, whereas when I run the same macro from a template, the shortcut target location is desktop! Weird?
    Last edited by thecdnmole; 09-27-2014 at 08:51 AM.

  6. #6
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Create Excel Template shortcut on first open

    Upon further research I have found that when you open a template, what is actually opening is a regular spreadsheet, which would explain why the shortcut and link is for that instead of the template! Now my question is, how do I instruct the macro to make a shortcut of the excel file, which is a template and then save that shortcut to the desktop. This is slightly different than what I was doing by making a shortcut of the workbook that was opened. Any help would be appreciated! Thanks!!

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Excel Template shortcut on first open

    I'm confused. IF you open a template it usually opens a new workbook with no name yet. So my belief is your macro should do nothing yet. Then, when you save the workbook for the first time and name/location for the new workbook finally does exist, THEN you would create the folder/shortcut. Am I missing something?

  8. #8
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Create Excel Template shortcut on first open

    The creation of shortcuts is done upon opening the spreadsheet. Would it work better if I did it when closing? I found this macro on the internet and it more or less work, just doesn't put anything in the cell "start in" in the shortcut properties.

    Please Login or Register  to view this content.
    Is there code I can put in to populate that in the link properties?
    desktop_link.JPG

+ 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. [SOLVED] can i create a shortcut to open a spreadsheet read only?
    By Mark in forum Excel General
    Replies: 2
    Last Post: 07-13-2015, 02:32 PM
  2. Macro to create desktop shortcut. Worked, but saved sheet as template, now not.
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2014, 10:18 AM
  3. Create the user form shortcut without open Excel workbook. Does it possible?
    By pyol17 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2012, 11:47 PM
  4. Replies: 2
    Last Post: 08-17-2009, 08:27 AM
  5. [SOLVED] How to open xl and create a new document based on a template
    By Colin Wilson in forum Excel General
    Replies: 2
    Last Post: 12-02-2005, 09:10 AM

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