Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Active Workbook Path

Excel 2003 - I can't seem to capture the path of the current workbook. My
workbook is located at ...\My Documents\Temp Forms\ but

MsgBox ThisWorkbook.Path returns ...\Microsoft\Excel\XLSTART
and
MsgBox ActiveWorkbook.Path returns nothing

I'm trying to save one worksheet of a workbook in the "same" directory
(whatever that happens to be at a given time). The saving part of my macro
works, but the path part doesn't.

Thanks in advance for your help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Active Workbook Path

It looks like you are running the code in you personal workbook as that is
its address. Putting ThisWorkbook.Path in your personal.xls returns what you
saw, putting it in the activeworkbook you get the correct answer.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Dorci" wrote:

Excel 2003 - I can't seem to capture the path of the current workbook. My
workbook is located at ...\My Documents\Temp Forms\ but

MsgBox ThisWorkbook.Path returns ...\Microsoft\Excel\XLSTART
and
MsgBox ActiveWorkbook.Path returns nothing

I'm trying to save one worksheet of a workbook in the "same" directory
(whatever that happens to be at a given time). The saving part of my macro
works, but the path part doesn't.

Thanks in advance for your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Active Workbook Path

I need the macro to be available in any workbook that is opened. Is there
some way to keep the macro in personal.xls (which is hidden) but refer to the
active workbook? -Thanks.

"John Bundy" wrote:

It looks like you are running the code in you personal workbook as that is
its address. Putting ThisWorkbook.Path in your personal.xls returns what you
saw, putting it in the activeworkbook you get the correct answer.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Dorci" wrote:

Excel 2003 - I can't seem to capture the path of the current workbook. My
workbook is located at ...\My Documents\Temp Forms\ but

MsgBox ThisWorkbook.Path returns ...\Microsoft\Excel\XLSTART
and
MsgBox ActiveWorkbook.Path returns nothing

I'm trying to save one worksheet of a workbook in the "same" directory
(whatever that happens to be at a given time). The saving part of my macro
works, but the path part doesn't.

Thanks in advance for your help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is path name added to active cell when Excel file is saved? [email protected] Excel Discussion (Misc queries) 1 June 28th 07 04:39 PM
Determining the full path and filename of an active workbook Aaron Dyck Excel Programming 1 August 31st 06 03:20 AM
macro to paste active cell's full path into another cell yoram Excel Programming 4 February 21st 06 11:15 PM
Get the path to the directory that the active workbook is in Raman325[_12_] Excel Programming 1 July 1st 05 06:13 PM
Preventing opening workbook inside active workbook. Serge[_4_] Excel Programming 2 November 4th 03 07:51 PM


All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"