Home |
Search |
Today's Posts |
#1
|
|||
|
|||
"Select Table" dialog with no table selectable
Hello all,
our automatic mailmerge system has been working for years. Quite recently, we finally upgraded the system to a Windows 2000 machine with Office 2003 installed. Most of the jobs provided to the mailmerge application are still processed without the slightest problem: the Word and Excel documents are provided, and the application produces the merged documents to be sent to the proper recipients. But a new problem arised, affecting very few (yet annoying) documents: sometimes Word displays a dialog box titled "Select Table", showing NO tables (nor sheets, nor anything else: just an empty list is shown). If we copy the data contained into the Excel document (the first sheet of it), and paste it into a fresh new document, and then feed it to the application, it works without showing that annoying and blocking dialog box. The documents affected by this problem are provided by our customers, which cannot explain how (strange) they created these documents. What is the problem? Why does it happen? Thank you very much Regards, Alessio Gordini |
#2
|
|||
|
|||
Hi Alessio
But a new problem arised, affecting very few (yet annoying) documents: sometimes Word displays a dialog box titled "Select Table", showing NO tables (nor sheets, nor anything else: just an empty list is shown). I take it your macro code is setting up the link to the data source file (OpenDataSource method)? This sounds like the macro code is set up for a DDE connection in Word 2000, or earlier, and is being run on Word 2002 or 2003. The default connection method in Word 2002/2003 is OLE DB, and it uses practically the same syntax as the DDE connection. (IOW, MS didn't pay the right kind of attention to backwards compatbility for the OpenDataSource method). You probably need to edit your code and add the SubType argument to the OpenDataSource method. Record a macro to create a DDE connection to this type of file to get the value you need to pass to the argument. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#3
|
|||
|
|||
Hi Cindy,
thank you for your answer. I take it you mean that my code (which is a C++ application working with Word2003) should use explicitly DDE. Actually, the application currently works with the following Connection string (the 12th argument passed to the OpenDataSource method): "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" + sDataSourcePath + ";Mode=Read;Extended Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:Engine Type=35" while, if I understand what you said, I should replace the use of Jet OLEDB with the use of DDE. Is it correct? But I have two questions: 1) why does the current application works with most of the mailmerge documents submitted to it? 2) why doesn't it work with only some othe documents? Thank you Alessio |
#4
|
|||
|
|||
Hi Alessio
Ah, OK, your connection is using OLE DB. Usually, when you see the message you report, with an OLE DB connection, it usually one of the other arguments is missing, such as an SQLStatement or a TableName. Why this would be happening in some instances, and not others, is difficult to determine without knowing more about how the documents were created, and what criteria decide which parameters + values are being passed to the OpenDatasource method. Given that you can resolve the problem by copying/pasting to a new Excel Workbook, I'd be inclined to guess that there may be some file damage in the workbooks you're being sent that's preventing the OLE DB connection from "seeing" the worksheet. In your situation, I'd probably 1. test what happens if you try to manually make the connection, in the Word UI 2. If it works, record that in a macro and compare the code 3. If it doesn't work, see if connecting using ODBC works. If it does, record that in a macro and adjust your code to use an ODBC connection method instead of OLE DB. In my experience ODBC is the most reliable, across all Office versions, with an Access or Excel data source. thank you for your answer. I take it you mean that my code (which is a C++ application working with Word2003) should use explicitly DDE. Actually, the application currently works with the following Connection string (the 12th argument passed to the OpenDataSource method): "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" + sDataSourcePath + ";Mode=Read;Extended Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:Engine Type=35" while, if I understand what you said, I should replace the use of Jet OLEDB with the use of DDE. Is it correct? But I have two questions: 1) why does the current application works with most of the mailmerge documents submitted to it? 2) why doesn't it work with only some othe documents? Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select specific cells in table via macro | Microsoft Word Help | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
Select Table dialog box comes up twice when open data source | Mailmerge | |||
Select Table dialog box after choosing data source | Mailmerge | |||
Select Table dialog box after choosing data source | Mailmerge |