Need some advice

G

Guest

I was trying to build a small utility macro using the =cell("filename")
function [I've found I am typing that quite a bit these days], but it keeps
getting hung up, so I'm coming to you good folk with hat in hand for some
much needed advice. Here is the 3 line macro - pretty simple, yet
aggrevating!
Sub FilePathName()
ActiveCell.Value = cell("filename")
End Sub
Ok - so what am I missing here!

Thanks for your help!
 
D

Don Guillett

try
Sub FilePathName()
'ActiveCell.Value = cell("filename")
ActiveCell = ActiveWorkbook.Name
End Sub
 
G

Guest

Cell is a worksheet function that is unavailable in VBS. The same information
can be had using

activeworkbook.path & "\" & activeworkbook.fullname
 
F

Frank Kabel

Hi Don
or maybe :)
ActiveCell = ActiveWorkbook.FullName

--
Regards
Frank Kabel
Frankfurt, Germany

Don Guillett said:
try
Sub FilePathName()
'ActiveCell.Value = cell("filename")
ActiveCell = ActiveWorkbook.Name
End Sub


--
Don Guillett
SalesAid Software
(e-mail address removed)
gjmink said:
I was trying to build a small utility macro using the =cell("filename")
function [I've found I am typing that quite a bit these days], but
it
keeps
getting hung up, so I'm coming to you good folk with hat in hand for some
much needed advice. Here is the 3 line macro - pretty simple, yet
aggrevating!
Sub FilePathName()
ActiveCell.Value = cell("filename")
End Sub
Ok - so what am I missing here!

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top