You can do that through ActiveX automation:
Dim xls As Excel.Application
Dim wd As Word.Application
Dim wk as Excel.Workbook
Dim doc As Word.Document
'Start Excel and open a new Workbook
Set xls=New Excel.Application
xls.Visible=True
Set wk=xls.Workbooks.Add("[Path to an Excel workbook template"])
''Start Word and add a new document
Set wd=New Word.Application
wd.Visible=True
Set doc=wd.Documents.Add("[Path to an Word document template"])
'Do something with the new workbook and the new document
wk.Close True
doc.Close True
xls.Quit
wd.Quit
"bdtmike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I need to create a new blank document (e.g. Word, Excel, etc) from
> within VBA.
> This is the equivalent to right clicking on the desktop and clicking
> "New..."
>
> Is there a shell API function that will let me do this?
>
|