View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alex Guardiet Alex Guardiet is offline
external usenet poster
 
Posts: 6
Default File name into a variable

No it does not. It gives the name of the excel file. "ThisWorkbook" means "this excel file". Please try out the code before replying, as you mislead other users.

" wrote:

The code gives the name of the VB file, not the excel
file. Is there a way to give the name of the excel file?

-----Original Message-----
Hi,

Supposing the variable is called 's', you would do:

Dim s As String
s = ThisWorkbook.name

Regards,

Alex

"Tim" wrote:

In an excel macro, how can I place the name of the file

I
am working on into a variable?

Thanks for your help in advance,
Tim

.