Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user of
my program should have the ability to select the datasource for a pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated from
German error message)




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

According to the Help entry for "Built-In Dialog Box Argument Lists", this
dialogs takes the arguments:
document_text1, document_text2, ..., read_only, type_of_link

You will need to research what they actually mean/expect.

NickHK

"THZS" wrote in message
...
I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user

of
my program should have the ability to select the datasource for a

pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated

from
German error message)






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

Thank you for your help.

I tried this in several variations of parametersets but I can't figure out
how it works. I always get the same error.

The macro-recorder method is useless here. It doesn't record the dialog,
only the result.




:-(

TZS

"NickHK" wrote:

According to the Help entry for "Built-In Dialog Box Argument Lists", this
dialogs takes the arguments:
document_text1, document_text2, ..., read_only, type_of_link

You will need to research what they actually mean/expect.

NickHK

"THZS" wrote in message
...
I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user

of
my program should have the ability to select the datasource for a

pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated

from
German error message)







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

I get a 1004 error if the workbook does not contain links.
If there are links, then this works:
Application.Dialogs(xlDialogOpenLinks).Show

However, I cannot get xlDialogChangeLink to work at all in XL2002.

NickHK

"THZS" wrote in message
...
I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user

of
my program should have the ability to select the datasource for a

pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated

from
German error message)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

Okay, that worked for me too. But sadly that is not the dialog I really need.
I want to open the dialog that is displayed when you select
"Insert/Pivottable" on the Ribbon or the related dialog that shows up if you
select "Options/Change Pivottable Datasource" (all menuitems translated back
from German). What ist the correct XlBuiltInDialog constant here?

Thomas

"NickHK" wrote:

I get a 1004 error if the workbook does not contain links.
If there are links, then this works:
Application.Dialogs(xlDialogOpenLinks).Show

However, I cannot get xlDialogChangeLink to work at all in XL2002.

NickHK

"THZS" wrote in message
...
I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user

of
my program should have the ability to select the datasource for a

pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated

from
German error message)









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Open "xlDialogChangeLink" Dialog with VBA/VB.Net

The Solution:


Sub PivotTableInsert()
'Source 1: Herbers Exelforum (Verknüpfungsdialog aus VBA aufrufen)
'Source 2: 2007 Office System Document: Lists of Control IDs
Dim oCntr As Office.CommandBarControl
'12247 = PivottableInsert
'12250 = ChangeDataSource
oCntr = Application.CommandBars.FindControl(Id:=12247)
If oCntr.Enabled Then oCntr.Execute()
End Sub

"THZS" wrote:

Okay, that worked for me too. But sadly that is not the dialog I really need.
I want to open the dialog that is displayed when you select
"Insert/Pivottable" on the Ribbon or the related dialog that shows up if you
select "Options/Change Pivottable Datasource" (all menuitems translated back
from German). What ist the correct XlBuiltInDialog constant here?

Thomas

"NickHK" wrote:

I get a 1004 error if the workbook does not contain links.
If there are links, then this works:
Application.Dialogs(xlDialogOpenLinks).Show

However, I cannot get xlDialogChangeLink to work at all in XL2002.

NickHK

"THZS" wrote in message
...
I want to open the "ChangeLink" Dialog in my Excel 2007 project. The user

of
my program should have the ability to select the datasource for a

pivottable.

Application.Dialogs(Excel.XlBuiltInDialog.xlDialog OpenLinks).Show() or
Application.Dialogs(Excel.XlBuiltInDialog.xlDialog ChangeLink).Show()


raise the following exception

"The show method of the dialog object can not be executed" (translated

from
German error message)







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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
My File Open Dialog is "permanently" maximised veryeavy Excel Discussion (Misc queries) 4 December 12th 07 02:35 PM
Add "Favorites" to the file open dialog box DOOGIE Setting up and Configuration of Excel 1 October 2nd 06 02:14 PM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM
Suppress "Disable/Enable Macros" and Query Refresh dialog on open Sharon Excel Programming 2 January 18th 06 09:20 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"