Reply
 
Thread Tools Display Modes
  #1   Report Post  
Paula Jern
 
Posts: n/a
Default Select Table dialog box comes up twice when open data source

Hi,
I have a macro that uses mail merge to print labels from an Excel file. The
Excel file always contains only one tab. I have the following code in my
macro:
ActiveDocument.MailMerge.OpenDataSource Name:=path, _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, connection:="Entire Spreadsheet",
SQLStatement _
:=""
When the user selects the data source to open, the 'Select Table' dialog box
comes up twice (with the same table name in it). I found that if I put
something like SELECT * FROM `export$` in the value for the SQLStatement
property, it suppresses one of the dialog boxes. The problem is, the name of
the table to select from may not always be the same. Does anyone know how I
can suppress one of the dialog boxes without hardcoding the table name?
Thank you!
Paula
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge data source in an Access database will not open Colin C Mailmerge 3 December 31st 04 12:01 AM
Cannot Find Its Data Source Dave Foote Mailmerge 3 December 17th 04 11:27 AM
Open Data Source Dialog Box Cindy M -WordMVP- Mailmerge 2 December 7th 04 08:22 PM
Select Table dialog box after choosing data source Paula Jern Mailmerge 1 December 4th 04 04:28 PM
Select Table dialog box after choosing data source Paula Jern Mailmerge 2 December 2nd 04 03:13 PM


All times are GMT +1. The time now is 08:40 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"