Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

How to find worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Curt - 03 Aug 2007 15:32 GMT
Have an Excel workbook trying to use a worksheet in the workbook for mail
merge. Know its my code . will not locate (MailE.xls) as data source. Here is
code line. Will some one hit me in the face so I can see what I am missing.
Excel folder is Parade also Parade is file in folder Have tried
"C:\parade\parade\MailE.xls" ThankMailE is merge doc.
Thanks

ChangeFileOpenDirectory "C:\Parade"
   Documents.Open FileName:="ThankMailE.doc", ConfirmConversions:=False, _

ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",
Russ - 03 Aug 2007 19:12 GMT
You have to enter the Windows path to that folder. What do you use outside
of Word in Windows Explorer to get to that file?

> Have an Excel workbook trying to use a worksheet in the workbook for mail
> merge. Know its my code . will not locate (MailE.xls) as data source. Here is
[quoted text clipped - 7 lines]
>
> ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Russ - 03 Aug 2007 19:23 GMT
One trick that I like to use to get a path, is to open a Dos window and
separately through Windows Explorer go to a file, then drag and drop that
file from Explorer on top of the Dos window. The full path to that file will
appear in the Dos window and you can copy it to the clipboard for pasting.
This works great for network paths, too.
To open a Dos window, go to Start button in Windows, click on Run, enter
cmd.

> Have an Excel workbook trying to use a worksheet in the workbook for mail
> merge. Know its my code . will not locate (MailE.xls) as data source. Here is
[quoted text clipped - 7 lines]
>
> ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Curt - 03 Aug 2007 20:00 GMT
Thanks for the input we all learn different tricks
Thanks again

> One trick that I like to use to get a path, is to open a Dos window and
> separately through Windows Explorer go to a file, then drag and drop that
[quoted text clipped - 15 lines]
> >
> > ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",
Curt - 03 Aug 2007 20:42 GMT
path shows up as you stated all I need is to get into file for a worksheet it
is a Excel worksheet in Parade.xls

> One trick that I like to use to get a path, is to open a Dos window and
> separately through Windows Explorer go to a file, then drag and drop that
[quoted text clipped - 15 lines]
> >
> > ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",
Russ - 04 Aug 2007 07:32 GMT
I typed in opendatasource into Word VBA Help and the opendatasource method
help had this snippet of help for the connection parameter:

****Quote
Connection   Optional Variant. A range within which the query specified by
SQLStatement is to be performed. How you specify the range depends on how
data is retrieved. For example:
>  When retrieving data through ODBC, you specify a connection string.
>  When retrieving data from Microsoft Excel using dynamic data exchange
(DDE) (Windows only), you specify a named range.
>  When retrieving data from Microsoft Access (Windows only), you specify
the word "Table" or "Query" followed by the name of a table or query.
****UnQuote

So create a named range for the worksheet data in Excel and pass that as the
Connection parameter. And maybe a SQLStatement query on that range is not
actually needed, so try it first without using a SQLStatement.

> path shows up as you stated all I need is to get into file for a worksheet it
> is a Excel worksheet in Parade.xls
[quoted text clipped - 19 lines]
>>>
>>> ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Curt - 04 Aug 2007 18:14 GMT
For one learning you are a great asset your explanation makes sense.
Thanks

> I typed in opendatasource into Word VBA Help and the opendatasource method
> help had this snippet of help for the connection parameter:
[quoted text clipped - 37 lines]
> >>>
> >>> ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",
Curt - 06 Aug 2007 14:20 GMT
Gaining on operation noe I am looking as to where I create another OLE app.
Waiting to complets. Any way thanks your expl sure helped

> I typed in opendatasource into Word VBA Help and the opendatasource method
> help had this snippet of help for the connection parameter:
[quoted text clipped - 37 lines]
> >>>
> >>> ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade.xls\MailE.xls",
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.