Path

R

rjtaylor

Hi I am having a problem. I thought that thisworkbook.path would give m
the path of the current workbook.
If I set a= thisworkbook.path
a =""
I dont understand what I changed. I use to set the DefaultFilePath t
nothing.
Now I am trying to distribute the file and I need to set the curdir t
the dirertory of the open workbook. I can navigate from there but
cant seem to do this even if I set DefaultFilePath to "" Since th
workbook is already open.
Rod Taylo
 
D

Dave Peterson

Thisworkbook.path will give the path for the workbook containing the code--and
that's not always the activeworkbook.

Activeworkbook.path will give the path for the active workbook--not always the
one with the code.

The only time I've seen the .path return "" is if the workbook hasn't been ever
saved--it's been created File|New (or the equivalent in code).
 
T

Tom Ogilvy

A workbook doesn't have a path until it has been saved.

Perhaps you are setting it before the workbook has been saved.

DefaultFilePath is only applicable when Excel starts up. You should need to
work with that attribute.
 
M

Myrna Larson

If the workbook has never been saved, it doesn't have a path. Could this be
the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top