Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
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
Fill out Word template form from Excel spreadsheet YiChing Excel Discussion (Misc queries) 1 March 31st 09 10:53 PM
how to create a new workbook based on a template... jimc Excel Programming 3 June 17th 07 02:54 AM
How would I create a fillable excel spreadsheet template? bpsig6991 Excel Discussion (Misc queries) 1 August 22nd 06 06:54 PM
how to create and use a new spreadsheet based on a template Shady Excel Discussion (Misc queries) 3 April 3rd 05 09:50 PM
automatically create another spreadsheet from template Joshua Excel Programming 1 November 12th 03 10:33 PM


All times are GMT +1. The time now is 05:35 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"