Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Mailmerge data source in an Access database will not open | Mailmerge | |||
Cannot Find Its Data Source | Mailmerge | |||
Open Data Source Dialog Box | Mailmerge | |||
Select Table dialog box after choosing data source | Mailmerge | |||
Select Table dialog box after choosing data source | Mailmerge |