Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create new spreadsheet based on template from macro in Word
Hello,
I am trying to put my Excel templates on a menu in Word along with my Word templates, hoping that I can create a new spreadsheet based on my Excel template. I have these two macros which I have tried with no luck: Sub Tryit() Dim xlApp As Object Dim xlWB As Object Dim xlWS As Object Dim cRows As Long Dim i As Long Set xlApp = CreateObject("Excel.Application") Set xlWB = xlApp.Workbooks.Add("C:\Program Files\Microsoft Office\Templates\Timetable\Rule16 fed.xlt") Set xlWS = xlWB.Worksheets(1) End Sub Sub tryitagain() Dim xlWB As Object Dim xlWS As Object Dim cRows As Long Dim i As Long Set xlApp = CreateObject("Excel.Application") Set xlWB = xlApp.Workbooks.Add(Template:="C:\Program Files\Microsoft Office\Templates\Timetable\Rule16 fed.xlt") Set xlWS = xlWB.Worksheets(1) End Sub I'm using Word and Excel 2003. Can anyone help me? Thanks for your time. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create new spreadsheet based on template from macro in Word
Hi Angie
Probabli Excel is open, but invisible. Try to include the followin statement: xlApp.Visible = True Bye Joe "Angie M." escreveu na mensagem ... Hello, I am trying to put my Excel templates on a menu in Word along with my Word templates, hoping that I can create a new spreadsheet based on my Excel template. I have these two macros which I have tried with no luck: Sub Tryit() Dim xlApp As Object Dim xlWB As Object Dim xlWS As Object Dim cRows As Long Dim i As Long Set xlApp = CreateObject("Excel.Application") Set xlWB = xlApp.Workbooks.Add("C:\Program Files\Microsoft Office\Templates\Timetable\Rule16 fed.xlt") Set xlWS = xlWB.Worksheets(1) End Sub Sub tryitagain() Dim xlWB As Object Dim xlWS As Object Dim cRows As Long Dim i As Long Set xlApp = CreateObject("Excel.Application") Set xlWB = xlApp.Workbooks.Add(Template:="C:\Program Files\Microsoft Office\Templates\Timetable\Rule16 fed.xlt") Set xlWS = xlWB.Worksheets(1) End Sub I'm using Word and Excel 2003. Can anyone help me? Thanks for your time. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill out Word template form from Excel spreadsheet | Excel Discussion (Misc queries) | |||
how to create a new workbook based on a template... | Excel Programming | |||
How would I create a fillable excel spreadsheet template? | Excel Discussion (Misc queries) | |||
how to create and use a new spreadsheet based on a template | Excel Discussion (Misc queries) | |||
automatically create another spreadsheet from template | Excel Programming |