Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Setting a defaut path in a Macro

if the file has been saved you can extract the path from the file name .I
paste this name into a couple of cells and manipulate it and use it in the
path,because different people save this file in different places.My main
macro calls this first


Sub printpath()
Dim myfull As String

myfull = ActiveWorkbook.FullName
Range("fullr").Formula = myfull
--
paul
remove nospam for email addy!



"seisman" wrote:

The way I do this type of thing is to save the filename and path in the
Registry. VB has a special area in the registry at
"HKEY_CURRENT_USER\Software\VB and VBA Program Settings" and the
SaveSetting method and GetSetting function will put a string into a key
at this location and read from it. SaveSetting is used something
like:

SaveSetting "Application title", "My Key Name", "My Data Value Name",
MyString

and GetSetting is used like

MyString = GetSetting "Application title", "My Key Name", "My Data
Value Name"

Hope this helps.

Seiscons


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
Setting a path to a folder Boots Excel Discussion (Misc queries) 2 August 10th 06 02:14 PM
Setiiing up file name & path as a default setting on all sheets/ta Paul Canal Excel Discussion (Misc queries) 3 March 31st 06 01:07 PM
WhatsThisHelp in VBA - setting the help file path programmatically seisman Excel Programming 2 July 29th 05 03:06 PM
change defaut workbook font color Ak_Deeg Excel Discussion (Misc queries) 1 February 13th 05 01:43 PM
Setting the Help 4.0 file name and path in a locked project Tony C[_3_] Excel Programming 5 November 13th 04 04:15 PM


All times are GMT +1. The time now is 03:27 PM.

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"