none
Changing Workbook type (xltx->xltm) after VSTO Document level customization project creation? RRS feed

  • Question

  • Hi!

    I've got a VSTO solution containing a workbook template (x.xltx).Now a problem has popped up that needs VBA code to solve it.

    Is there a way to change the template type without losing all that VSTO code?

    Lots of Greetings!

    Volker


    Volker

    Thursday, August 23, 2012 9:55 AM

Answers

All replies

  • Hi Volker,

    Thank you for posting in the MSDN Forum.

    In terms of your issue, I think you can open workbook of the xltx type firstly, then save it as a file of the xltm type via running a macro. Please refer to this

    Sub Test()
      ActiveWorkbook = Application.Workbooks.Open("C:\Documents\x.xltx")
      ActiveWorkbook.SaveAs ("C:\Document\x.xltm")
    End Sub
    

    Hope this can help you.

    Best Regards,


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, August 24, 2012 2:10 AM
    Moderator
  • Hi!

    This isn't my problem, naturally I can save a workbook template as a macro enabled workbook template.

    My problem is with the visual studio project.

    This is what I got right now:

    Current solution content

    So far I haven't found a way to change this to

    What I want to have

    Simply renaming it causes an  error when excel starts.

    Is there any way?


    Volker

    Friday, August 24, 2012 8:32 AM
  • Hi Volker,

    I would suggest you use a text editor to design a file extension and apply it.You can specify the editor or designer in which documents of a certain type will open in the integrated development environment. For more details, please refer to http://msdn.microsoft.com/en-us/library/ms165326(v=vs.100)

    Milan


    • Edited by Milan_x Tuesday, August 28, 2012 3:06 AM
    Tuesday, August 28, 2012 2:55 AM
  • Hi Volker,

    I would suggest you use a text editor to design a file extension and apply it.You can specify the editor or designer in which documents of a certain type will open in the integrated development environment.

    As far as I understand you that still doesn't turn an xltx into an xltm file, correct?

    Sorry.

    Lots of thanks anyway!

    Volker


    Volker

    Tuesday, August 28, 2012 10:40 AM
  • Hi Volker,

    As far as I know, it seems that you have to change the workbook file type outside the Visual Studio environment and create a new project for the workbook file.

    There is a thread which has the similar problem with you. Hope it can help you.

    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/d30cbdf2-388f-4b96-b7b1-5a0dc25b0e01

    Best Regards,


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Hetzi Friday, August 31, 2012 1:22 PM
    Thursday, August 30, 2012 1:56 AM
    Moderator