![]() |
|
|
|
#1
|
||||
|
||||
|
When the code fails, what is the value of StrWkBkNm?
StrWkBkNm = ThisDocument.Path & "\dados.xlsx" ThisDocument.Path would fail in two potential ways: - Document hasn't been saved therefore it has no path - Code is in a template and not in the document itself. If that is the case, ThisDocument.Path would return the template path, not the document path. Step through the code one line at a time and keep an eye on the variables that are assigned values as you go. If you see something unexpected, investigate what the reason is for that.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
||||
|
||||
|
Quote:
Code:
If Dir(StrWkBkNm) = "" Then MsgBox "Cannot find the designated workbook: " & StrWkBkNm, vbExclamation Exit Sub End If
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| lesson plan template, teacher help |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Dynamically changing drop-down list based on selection? (Word Form)
|
laurarem | Word | 1 | 02-21-2013 10:17 PM |
How to import a list of names into PowerPoint from Excel?
|
CarpetRemnant | PowerPoint | 4 | 12-07-2012 11:08 AM |
| Drop down list, Can it be done??? | garethreid | Outlook | 0 | 08-09-2012 06:08 AM |
drop down list from external data source Excel 2007?
|
Intruder | Excel | 1 | 08-03-2012 05:41 AM |
| Long List for drop down box | DLo99 | Word | 0 | 02-28-2010 08:07 AM |