Quote:
Originally Posted by macropod
So how did Excel create the workbook? I don't see any code for that. Also, is whatever is being returned by ws_vh.Range("B4") a valid workbook name (including the extension) and does that workbook have a sheet named 'CORE'?
|
I was hoping you might be able to answer that LOL! That never happened until I made the changes you the set odoc statement. {Not saying its the cause but may have allowed us to uncover a problem.) DATA1 is the folder in which the data source file exists. In my testing, ws_vh.range("B4") = Aug-30 (Sun) schedule_3.xlsx , which exists in folder DATA1. This file has a worksheet called "CORE" in addition to another called "STAFF"
StrSrc = the path of the file ("H:\PWS\Parks\Parks Operations\Sports\Sports15\DATA1\") and the file name from ws_vh.Range("B4") resulting in "H:\PWS\Parks\Parks Operations\Sports\Sports15\DATA1\Aug-30 (Sun) schedule_3.xlsx
I have a msgbox following the creation of StrSrc to confirm that the the path and file (ie the value of StrSrc is correct, and as far as I can see it is.
When I created this mail merge document, in the selecting recipients stage, I had to select the path, file and worksheet of the data source before I could continue populating the mail merge document with fields. That all worked as planned. To test manually, I set an sql to filter out only DR as type.