View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andreas Maistmann Andreas Maistmann is offline
external usenet poster
 
Posts: 3
Default Problem with Dialogs(xlDialogWorkbookNew)

Jim, thanks for your answer.

xlDialogNew opens the task pane on my system, that is not what I want.

Dialogs(xlDialogWorkbookNew) opens exactly the dialog I want, but the
problem is, it did not work the way I wanted it. When I open the dialog
from the link in the task pane instead (with "General templates...")
all works fine. But when I use Dialogs(xlDialogWorkbookNew) a new
template is not opened, but inserted in an already open workbook.

It would be of interest to me, if you somebody can reproduce this
behaviour.
1. create a template test.xlt and save it to the templates folder
2. rename one sheet in test.xlt to something different e.g. testsheet,
delete all other sheets and then save & exit test.xlt
3. Exit Excel and open it again. you will see your standard new
workbook with the standard sheet1 to sheet3 in it
4. Go to Extra-Macro-Visual Basic and execute the command
dlgAnswer = Application.Dialogs(xlDialogWorkbookNew).Show
in the direct window
5. In the now open template dialog, select your template test.xlt

When it opens I see a workbook with four sheets, which are the three
standard sheet1 to sheet3 plus the renamed testsheet from test.xlt.
This is, because Excel has not created a new Workbook based on test.xlt
as it should, but it has merged the sheets from test.xlt into the
currently open workbook.

But then again, maybe that is only me, and nobody else experiences this
strange behaviour.

thanks again, for any help

Andreas