473,388 Members | 1,385 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Regarding Relative path in Macros

Hi All,

I am using absolute path in my macro code, but i want to change it to relative path. I am not sure what exactly relative path will do how to use relative path in macro. Please can any one give me any idea on this.

Here is my path in code

Set Wkb2 = Workbooks.Open(Filename:="C:\Documents and Settings\admin\Desktop\Folder\Input\Manpower_10.xl s")
Wkb2.Activate


Thanks in Advance

Teja
Jun 18 '10 #1
1 2360
TheSmileyCoder
2,322 Expert Mod 2GB
Are we talking purely Excel here?

Relative to what? Your excel sheet?

Here are a few commands you may find usefull:
Expand|Select|Wrap|Line Numbers
  1. 'To get the path of the excel workbook:
  2.    ActiveWorkbook.Path 
  3. 'To get Path and filename:
  4.    ActiveWorkbook.FullName
  5. 'To get just Filename
  6.    ActiveWorkbook.Name
Jun 18 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
8
by: dw | last post by:
Hello, all. I have a site that I'm testing on my LOCALHOST and also on a remote server, depending on whether I'm at work or at home. I don't want the OLEDBDATAAdapter to be pointing to the remote...
6
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
4
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is...
2
by: Jordan Richard | last post by:
Put another way, is there any way I can tell ASP.NET to convert a path (imbedded in a string variable, "~/images/some_image.gif") to a root-relative path, that the client will understand, for the...
1
by: damiensawyer | last post by:
Hi all, I hope that this question isn't too simple... I am storing all of my webforms in a /forms directory (with the exception of Default.aspx). I have created the following code in...
1
by: Coaster | last post by:
If I am calling File.CopyTo make a backup copy of a remote file on a remote machine where the source and destination locations are both on the remote machine would it be faster to call the function...
2
by: BD | last post by:
Hi there. Using 8.2 on Windows. I have a situation where I have a db backup, which I want to deploy to a group of developer workstations. The target directory for the database files will be...
0
by: swatii | last post by:
I am developing application in c#.net and I am using crystal reports. I want to dynamically load crystal report in report document so that from the same form I can access all the reports. for this...
6
by: teja1234 | last post by:
Hi All, I am using absolute path in my macro code, but i want to change it to relative path. I am not sure what exactly relative path will do how to use relative path in macro. Please can any one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.