LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default "lst" file does not work

I have a program that make a list of "lst" under one directory and then
create a hyperlink for each one (see below). The program runs prefectly just
the hyperlinks do not work.

I am thinking that perhaps when I open the "lst" file in manually in excel I
got the TEXT IMPORT WIZARD window message that allow me to choose:
1.- In the first step DELIMITED.
2.- In the 2nd step SPACE ONLY
3.- In the trird step GENERAL.

Do you think is possible to adjust the hyperlink to read the step shown
above?.

Thanks in advance.
Maperalia

'****START PROGRAM****
Option Explicit

Sub List_lst_Files()

Dim FName As String
Dim r As Integer
Dim i As Long
Dim MyPath As String
Dim WO As String
Const strFileType As String = "lst"



With ActiveSheet.Columns(1)
..Hyperlinks.Delete
..ClearContents
End With



WO = Application.InputBox("Enter Work Order Number")

MyPath = "S:\test\locations\" & WO & "\"

On Error Resume Next
Worksheets("List of lst Files").Delete
On Error GoTo 0
Application.DisplayAlerts = True
Worksheets.Add.Name = "List of lst Files"


r = 2
With Application.FileSearch
.NewSearch
.LookIn = MyPath
.SearchSubFolders = True
.Filename = "*." & strFileType
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
FName = Mid(.FoundFiles(i), 1)
Cells(r, 1) = Mid(FName, Len(MyPath) + 1, 255)

ActiveSheet.Hyperlinks.Add Anchor:=Cells(r, 1),
Address:=FName, TextToDisplay:=Cells(r, 1).Value
r = r + 1
Next i
End If
End With


ActiveSheet.Select
Range("A1").Select



End Sub
'****END PROGRAM****

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
"Open With" Excel Does Not Work For TXT File Extension Rick Hamilton Excel Discussion (Misc queries) 4 September 17th 07 03:26 AM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
pictures to work with "data" "sort" option arad Excel Discussion (Misc queries) 1 April 18th 06 09:15 PM
Problem- Recording macros for "file save" and "File open" tritaco Excel Programming 1 April 22nd 04 06:15 PM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"