Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for a file on the server via EXCEL

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US

I'm trying to append a link in one of my excel document that would actually check if a related document created in word is present. How can I do this guys???


[tt]Here's the scenario:[/tt]
A data tech starts and completes a job. For every job there MUST be a structure or flow-chart created in word named the current job nubmer (i.e. 12345flow.doc) and placed the server in a folder named jobnumber (i.e. 12345).

On an excel report each data tech uses with every job, I want to place a link to this 12345 server folder and check if the flow-chart has been created.

Got it? Cool! I hope you guys can help me. [tt]

"The reward of one duty done is the power to fulfill another"[/tt]
--------------------------------------------
[afro][love][medal][noevil][pc3]
 
Hi,

In Excel VBA there is a method called...
Code:
GetOpenFilename Method
                

Displays the standard Open dialog box and gets a file name from the user without actually opening any files.

Syntax

expression.GetOpenFilename(FileFilter, FilterIndex, Title, ButtonText, MultiSelect)

expression   Required. An expression that returns an Application object.

FileFilter   Optional Variant. A string specifying file filtering criteria. 

This string consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. Each separate pair is listed in the Files of type drop-down list box. For example, the following string specifies two file filters—text and addin: "Text Files (*.txt),*.txt,Add-In Files (*.xla),*.xla".

To use multiple MS-DOS wildcard expressions for a single file filter type, separate the wildcard expressions with semicolons; for example, "Visual Basic Files (*.bas; *.txt),*.bas;*.txt".

If omitted, this argument defaults to "All Files (*.*),*.*".

FilterIndex   Optional Variant. Specifies the index numbers of the default file filtering criteria, from 1 to the number of filters specified in FileFilter. If this argument is omitted or greater than the number of filters present, the first file filter is used.

Title   Optional Variant. Specifies the title of the dialog box. If this argument is omitted, the title is "Open."

ButtonText   Optional Variant. Macintosh only.

MultiSelect   Optional Variant. True to allow multiple file names to be selected. False to allow only one file name to be selected. The default value is False

Remarks

This method returns the selected file name or the name entered by the user. The returned name may include a path specification. If MultiSelect is True, the return value is an array of the selected file names (even if only one filename is selected). Returns False if the user cancels the dialog box.

This method may change the current drive or folder.
It can be coded to filter for *.DOC files. The Function returns the path and file name (or FALSE if the user Cancels the dialog). Just take the return value and store it.

VOLA! :) Skip,
metzgsk@voughtaircraft.com
 
Could you post a sample code sir so I can better understand this if possible??? I'm not to familiar with vba. [tt]

"The reward of one duty done is the power to fulfill another"[/tt]
--------------------------------------------
[afro][love][medal][noevil][pc3]
 
Check VB help...
Code:
GetOpenFilename Method Example

This example displays the Open dialog box, with the file filter set to text files. If the user chooses a file name, the code displays that file name in a message box.

fileToOpen = Application _
    .GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
    MsgBox &quot;Open &quot; & fileToOpen
End If
Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top