Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Visualbasic

Hello,

I work in admin, but have been given an urgent excel visual basic project to
complete

I have to redevelop a section to work from the current system directory, and
not the physical directory, the *.xls file was originally saved to

The runtime error I get is with this line of code.........ChDir
"C:\apps\data", but the files are all stored in c:\projects, but if a user
takes the files and installs them on a different directory on his or her
machine, there is no way i can know what directory on c:\ they will install
to, so i cant hardwire the code, so have to have some means, in vbasic of
having things to work from the current directory of whichever pc the files
are stored on

Please help

Thanks in advance
Jeff


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Excel Visualbasic


"Jeff" wrote in message
...
Hello,

I work in admin, but have been given an urgent excel visual basic project

to
complete

I have to redevelop a section to work from the current system directory,

and
not the physical directory, the *.xls file was originally saved to

The runtime error I get is with this line of code.........ChDir
"C:\apps\data", but the files are all stored in c:\projects, but if a user
takes the files and installs them on a different directory on his or her
machine, there is no way i can know what directory on c:\ they will

install
to, so i cant hardwire the code, so have to have some means, in vbasic of
having things to work from the current directory of whichever pc the files
are stored on

Please help

Thanks in advance
Jeff


If I understand you correctly, the user installs the xls files where he
wants. Then the user opens one.

You can then retrieve the directory of the open file using
Thisworkbook.Path

Is that what you wanted?

Geoff





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Visualbasic

Thisworkbook.path would refer to the workbook running the code. It seems
like Activeworkbook.Path might be more appropriate for the situation
described - unless the code being developed is going to be placed in each
workbook.

--
Regards,
Tom Ogilvy

"GB" wrote in message
...

"Jeff" wrote in message
...
Hello,

I work in admin, but have been given an urgent excel visual basic

project
to
complete

I have to redevelop a section to work from the current system directory,

and
not the physical directory, the *.xls file was originally saved to

The runtime error I get is with this line of code.........ChDir
"C:\apps\data", but the files are all stored in c:\projects, but if a

user
takes the files and installs them on a different directory on his or her
machine, there is no way i can know what directory on c:\ they will

install
to, so i cant hardwire the code, so have to have some means, in vbasic

of
having things to work from the current directory of whichever pc the

files
are stored on

Please help

Thanks in advance
Jeff


If I understand you correctly, the user installs the xls files where he
wants. Then the user opens one.

You can then retrieve the directory of the open file using
Thisworkbook.Path

Is that what you wanted?

Geoff







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
Come selezionare solo celle con font rosso con visualbasic Ivanobrb Excel Discussion (Misc queries) 2 September 18th 06 05:58 PM
how to track changes made to a excel sheet using VisualBasic Daffo Excel Discussion (Misc queries) 10 August 31st 06 06:10 AM


All times are GMT +1. The time now is 10:25 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"