Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I run a macro from a .xlt file

My program (Test.xlt) has code which opens another workbook (Calc.xlt) & then runs a macro from Calc.xlt.
My problem is that everytime the code runs, Calc.xlt opens as Calc1 & the next time as Calc2 & then Calc3 etc. This means the macro from within isn't recognised because my code refers to Openfile - Calc.xlt. and not Calc1, Calc2 etc.

How do I amend my code so that when Calc.xlt is opened, the macro is recognised as Calc1!RunMacro or Calc2!RunMacro or Calc3!RunMacro

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I run a macro from a .xlt file

make your workbook a normal workbook rather than a template.

--
Regards,
Tom Ogilvy

"Vinnie" wrote in message
...
My program (Test.xlt) has code which opens another workbook (Calc.xlt) &

then runs a macro from Calc.xlt.
My problem is that everytime the code runs, Calc.xlt opens as Calc1 & the

next time as Calc2 & then Calc3 etc. This means the macro from within isn't
recognised because my code refers to Openfile - Calc.xlt. and not Calc1,
Calc2 etc.

How do I amend my code so that when Calc.xlt is opened, the macro is

recognised as Calc1!RunMacro or Calc2!RunMacro or Calc3!RunMacro

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I run a macro from a .xlt file

Thanks Tom, however for the purposes of this project I need to keep the files as templates. Any other suggestions?

"Tom Ogilvy" wrote:

make your workbook a normal workbook rather than a template.

--
Regards,
Tom Ogilvy

"Vinnie" wrote in message
...
My program (Test.xlt) has code which opens another workbook (Calc.xlt) &

then runs a macro from Calc.xlt.
My problem is that everytime the code runs, Calc.xlt opens as Calc1 & the

next time as Calc2 & then Calc3 etc. This means the macro from within isn't
recognised because my code refers to Openfile - Calc.xlt. and not Calc1,
Calc2 etc.

How do I amend my code so that when Calc.xlt is opened, the macro is

recognised as Calc1!RunMacro or Calc2!RunMacro or Calc3!RunMacro

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I run a macro from a .xlt file

Sure, understand how templates work and code accordingly.

--
Regards,
Tom Ogilvy


"Vinnie" wrote in message
...
Thanks Tom, however for the purposes of this project I need to keep the

files as templates. Any other suggestions?

"Tom Ogilvy" wrote:

make your workbook a normal workbook rather than a template.

--
Regards,
Tom Ogilvy

"Vinnie" wrote in message
...
My program (Test.xlt) has code which opens another workbook (Calc.xlt)

&
then runs a macro from Calc.xlt.
My problem is that everytime the code runs, Calc.xlt opens as Calc1 &

the
next time as Calc2 & then Calc3 etc. This means the macro from within

isn't
recognised because my code refers to Openfile - Calc.xlt. and not Calc1,
Calc2 etc.

How do I amend my code so that when Calc.xlt is opened, the macro is

recognised as Calc1!RunMacro or Calc2!RunMacro or Calc3!RunMacro

Thanks






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro to pull data from another file - update name of file Don Excel Discussion (Misc queries) 2 February 10th 09 03:31 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"