Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with Dialogs(xlDialogWorkbookNew)

Hello,
I experience a strange behaviour, which I can't explain myself.

I would like to put a button on a Toolbar which opens the "new
workbook from template" Dialog. This is the Dialog which opens when
you select "General templates..." on the task pane. On the Net I
found the following code snippet for this:

dlgAnswer = Application.Dialogs(xlDialogWorkbookNew).Show

I created a procedure and linked it to a button on the toolbar. At
first sight this seemed to work fine, if you press the button, the
required dialog opens.

The first problem I encountered was, that the dialog only opens when
another workbook is already open, otherwise I got an error message.
This is not such a big problem, since you can work around this by open
some standard workbook, before invoking the mentioned dialog.

But the second problem I encountered gives me real headaches: When I
open a template in the dialog Excel didn't create a new workbook
based on that template, as I would have expected, but inserts the
selected template into the already open workbook. This means, if I had
a workbook with sheet1 and sheet2 open and invoked the dialog and
select a template with sheetx and sheety in it, I end up with a
woorkbook with four sheets (sheet1, sheet2, sheetx and sheety). Also
the color palette is the one of the workbook that was open at the
beginning.

I hope I could make the problem clear, if not, please ask and I will
try to clarify things.

I was able to reproduce this behaviour on office 2000, XP and 2003 (all
German version on WinXP).

What I would like to know is, can anybody else confirm this problem. Is
this a known bug, or am I doing something wrong? If somebody knows a
solution or a clever workaround, it will be of course much appreciated.

Thanks in advance for any help,
Andreas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Problem with Dialogs(xlDialogWorkbookNew)

Seems to me based on what you've said that you want this dialog:

xlDialogNew

--
Jim
"Andreas Maistmann" wrote in message
oups.com...
| Hello,
| I experience a strange behaviour, which I can't explain myself.
|
| I would like to put a button on a Toolbar which opens the "new
| workbook from template" Dialog. This is the Dialog which opens when
| you select "General templates..." on the task pane. On the Net I
| found the following code snippet for this:
|
| dlgAnswer = Application.Dialogs(xlDialogWorkbookNew).Show
|
| I created a procedure and linked it to a button on the toolbar. At
| first sight this seemed to work fine, if you press the button, the
| required dialog opens.
|
| The first problem I encountered was, that the dialog only opens when
| another workbook is already open, otherwise I got an error message.
| This is not such a big problem, since you can work around this by open
| some standard workbook, before invoking the mentioned dialog.
|
| But the second problem I encountered gives me real headaches: When I
| open a template in the dialog Excel didn't create a new workbook
| based on that template, as I would have expected, but inserts the
| selected template into the already open workbook. This means, if I had
| a workbook with sheet1 and sheet2 open and invoked the dialog and
| select a template with sheetx and sheety in it, I end up with a
| woorkbook with four sheets (sheet1, sheet2, sheetx and sheety). Also
| the color palette is the one of the workbook that was open at the
| beginning.
|
| I hope I could make the problem clear, if not, please ask and I will
| try to clarify things.
|
| I was able to reproduce this behaviour on office 2000, XP and 2003 (all
| German version on WinXP).
|
| What I would like to know is, can anybody else confirm this problem. Is
| this a known bug, or am I doing something wrong? If somebody knows a
| solution or a clever workaround, it will be of course much appreciated.
|
| Thanks in advance for any help,
| Andreas
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
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

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
The Dialogs collection James Butler Excel Programming 2 May 3rd 05 02:39 AM
Dialogs nc Excel Discussion (Misc queries) 1 March 23rd 05 02:17 PM
problems with dialogs François Excel Programming 5 February 21st 05 10:34 AM
Dialogs Command Stratuser Excel Programming 0 February 12th 04 03:43 PM
Using Dialogs Save Stratuser[_2_] Excel Programming 0 July 22nd 03 08:59 PM


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