Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In MS Word I used:
With Dialogs(wdDialogFileOpen) If .Display Then strSourceFile = WordBasic.FilenameInfo$(.Name, 1) End If End With to obtain the filename of the active document. How can I do this in Excel? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Claud
To get the filename of the activeworkbook, use sFileName=ActiveWorkbook.FullName If you want to display the open dialog and then open a workbook sFilename=Application.GetOpenFileName() Workbooks.Open FileName:=sFileName -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Claud Balls" wrote in message ... In MS Word I used: With Dialogs(wdDialogFileOpen) If .Display Then strSourceFile = WordBasic.FilenameInfo$(.Name, 1) End If End With to obtain the filename of the active document. How can I do this in Excel? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveWorkbook.Name
or ActiveWorkbook.FullName -- Regards Juan Pablo González "Claud Balls" wrote in message ... In MS Word I used: With Dialogs(wdDialogFileOpen) If .Display Then strSourceFile = WordBasic.FilenameInfo$(.Name, 1) End If End With to obtain the filename of the active document. How can I do this in Excel? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Claud,
Check out the GetOpenFilename method in VBA help. -- HTH RP (remove nothere from the email address if mailing direct) "Claud Balls" wrote in message ... In MS Word I used: With Dialogs(wdDialogFileOpen) If .Display Then strSourceFile = WordBasic.FilenameInfo$(.Name, 1) End If End With to obtain the filename of the active document. How can I do this in Excel? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
strSourceFile = ActiveWorkbook.Name or, if you want the path, too strSourceFile = ActiveWorkbook.FullName In article , Claud Balls wrote: In MS Word I used: With Dialogs(wdDialogFileOpen) If .Display Then strSourceFile = WordBasic.FilenameInfo$(.Name, 1) End If End With to obtain the filename of the active document. How can I do this in Excel? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
vlookup and filename returning same result on each sheet. | Excel Discussion (Misc queries) | |||
Saving filename same as import filename | Excel Programming | |||
Workbooks.Open(filename) : Returning err: Object reference not... (in VB.NET) | Excel Programming |