VBA- Getfile Method

Jzelenka

Board Regular
Joined
Jul 30, 2002
Messages
92
I need some VBA help. I am trying to use the getfile method and am looking under the help file. It tells me I need to write a pathspec for the current file I am using, and it says I can make an absolute or relative reference to the file.

I want to make the pathspec for getfilename refer to this file no matter where it is saved on the hardrive so that the code always works despite location of file saved.

Writing this pathspec is what I am unsure of. How do I write an absolute or relative reference for the file I am using?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
it is a workbook that I have 4 colums. When you press a button, it looks in the folder that it is saved in and brings over the file name, the type, the size, and the attributes of any file in the current folder.

In order to do this, I need a reference to the current workbook file so that no matter where it is saved, it will search the folder and bring in the information to the excel sheet.

sorry about not being so clear.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,986
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top