Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 97 VBA - CURDIR, not reliable

Hi,

I'm using Excel 97 and my whish is to use CURDIR as a way of makin
shure that when having 2 workbooks in a folder somewhere on a drive
will be able to open one from the other.

The problem is that I experience different results from this functio
when having opened a workbook.

P1 = CURDIR
MSGBOX P1

The short example above gives 2 different results in P1 when being use
in for example the "This Workbook" and "WorkBook_Open Sub".

1. Excel - File - Open - Choose - Open: gives always the right result
2. Excel - File - Open - Choose - Close - File - MRUlist: gives alway
the right result
3. Excel - File - MRUlist: gives different result
4. Filemanager - choose file: gives same as with 3.

Looking for an explanation and a way to make 1 - 4 work safely

Rickar

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 97 VBA - CURDIR, not reliable

If you want to know the location of the workbook being opened

p1 = thisworkbook.Path

curdir is the current directory for the currently default drive. this isn't
necessarily related to the workbook.

--
Regards,
Tom Ogilvy

"Ricke G " wrote in message
...
Hi,

I'm using Excel 97 and my whish is to use CURDIR as a way of making
shure that when having 2 workbooks in a folder somewhere on a drive I
will be able to open one from the other.

The problem is that I experience different results from this function
when having opened a workbook.

P1 = CURDIR
MSGBOX P1

The short example above gives 2 different results in P1 when being used
in for example the "This Workbook" and "WorkBook_Open Sub".

1. Excel - File - Open - Choose - Open: gives always the right result
2. Excel - File - Open - Choose - Close - File - MRUlist: gives always
the right result
3. Excel - File - MRUlist: gives different result
4. Filemanager - choose file: gives same as with 3.

Looking for an explanation and a way to make 1 - 4 work safely

Rickard


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Excel 97 VBA - CURDIR, not reliable

I have a similar situation but with 3 files. i put up
links on the sheet1 of each file for each of the other
files. when i wanted to open either of the other files, i
just click the link and the other file opened.
on the menu barinserthyperlink. click the file button.
worked for me.
-----Original Message-----
Hi,

I'm using Excel 97 and my whish is to use CURDIR as a way

of making
shure that when having 2 workbooks in a folder somewhere

on a drive I
will be able to open one from the other.

The problem is that I experience different results from

this function
when having opened a workbook.

P1 = CURDIR
MSGBOX P1

The short example above gives 2 different results in P1

when being used
in for example the "This Workbook" and "WorkBook_Open

Sub".

1. Excel - File - Open - Choose - Open: gives always the

right result
2. Excel - File - Open - Choose - Close - File - MRUlist:

gives always
the right result
3. Excel - File - MRUlist: gives different result
4. Filemanager - choose file: gives same as with 3.

Looking for an explanation and a way to make 1 - 4 work

safely

Rickard


---
Message posted from http://www.ExcelForum.com/

.

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
Is Excel reliable ראובן Excel Discussion (Misc queries) 18 August 8th 05 02:26 PM
FAST, RELIABLE, LEGAL MONEY MAKING OPPORTUNITY Vasant Nanavati Excel Programming 1 February 19th 04 03:42 AM
excel 2000 workbook.activate not 100% reliable with alt+tab Gavin Frayne Excel Programming 9 July 24th 03 09:29 AM


All times are GMT +1. The time now is 09:57 PM.

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

About Us

"It's about Microsoft Excel"