Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    excel templates and are they workbooks? (Excel 2000)

    Hello, A workbook I have has a macro which when executed it looks for a workbook called tools, the tools workbook is store in the same path as the current open workbook with the macro.
    my code,
    vToolbookPath = ActiveWorkbook.Path
    vToolbookPathFile = vToolbookPath & "" & Range("ToolbookPathFile").Value

    This works fine for an .xls file but when I conver t the workbook to a template the macro does not work,
    it seems its because the change in the file type that it does not work? is this true?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    What does the range named ToolbookPathFile contain?

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    What's in the cell referred to by the name "ToolbookPathFile"? That appears to where you are getting the filename from, and probably has the .xls extension on the end of the filename. Template files have an extension of .xlt. If the filename in that cell has an extension of .xls, then it will not match the template file name.
    Legare Coleman

  4. #4
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    ahhh ha, that was the culprit,

    thanks guys!

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    it seem now that the tools workbook can be .xlt or template but the workbook with the macro has to be .xls to work??

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    It depends on how you are using the code. Please keep in mind that when you create a new workbook from a template, it hasn't been saved yet, so ActiveWorkbook.Path isn't valid.

  7. #7
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel templates and are they workbooks? (Excel 2000)

    I don't understand your question. For a macro to work, it must be in an open workbook. If you open a .xlt file, it will become a .xls file. Could you explain in detail exactly what you are doing and what does not work?
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •