Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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****

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default "lst" file does not work

maperalia,

When I do it, the links are created and they work The files are opened in
Visual Studio, and I'm prompted twice whether I really want to open them but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default "lst" file does not work

Doug;
Thank for your quick response;
When I run the program the hyperlinks are created too. However, when I click
on them I have nothing. No file is opened!
In addtion, I need to open these hyperlinks in excel to have the option to
import the text in the way I have shown you in my previous message. I'm using
XL 2003, Win XP too.

Do you think there is a way to add a statement to add this TEST IMPORT
WIZARD?.

Thanks in advance.
Maperalia


"Doug Glancy" wrote:

maperalia,

When I do it, the links are created and they work The files are opened in
Visual Studio, and I'm prompted twice whether I really want to open them but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default "lst" file does not work

You will probably have to have the link link to the cell that contains the
hyperlink. Then use the followhyperlink event to open the file with the
Opentext method.

--
Regards,
Tom Ogilvy

"maperalia" wrote in message
...
Doug;
Thank for your quick response;
When I run the program the hyperlinks are created too. However, when I

click
on them I have nothing. No file is opened!
In addtion, I need to open these hyperlinks in excel to have the option to
import the text in the way I have shown you in my previous message. I'm

using
XL 2003, Win XP too.

Do you think there is a way to add a statement to add this TEST IMPORT
WIZARD?.

Thanks in advance.
Maperalia


"Doug Glancy" wrote:

maperalia,

When I do it, the links are created and they work The files are opened

in
Visual Studio, and I'm prompted twice whether I really want to open them

but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default "lst" file does not work

maperalia,

I'm sorry, I don't know the answer to your question.

Doug


"maperalia" wrote in message
...
Doug;
Thank for your quick response;
When I run the program the hyperlinks are created too. However, when I
click
on them I have nothing. No file is opened!
In addtion, I need to open these hyperlinks in excel to have the option to
import the text in the way I have shown you in my previous message. I'm
using
XL 2003, Win XP too.

Do you think there is a way to add a statement to add this TEST IMPORT
WIZARD?.

Thanks in advance.
Maperalia


"Doug Glancy" wrote:

maperalia,

When I do it, the links are created and they work The files are opened
in
Visual Studio, and I'm prompted twice whether I really want to open them
but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default "lst" file does not work

Tom;
Thanks for your advice but I did not follow it very well. Could you please
explain me that in other way.

Thanks.
Maperalia


"Tom Ogilvy" wrote:

You will probably have to have the link link to the cell that contains the
hyperlink. Then use the followhyperlink event to open the file with the
Opentext method.

--
Regards,
Tom Ogilvy

"maperalia" wrote in message
...
Doug;
Thank for your quick response;
When I run the program the hyperlinks are created too. However, when I

click
on them I have nothing. No file is opened!
In addtion, I need to open these hyperlinks in excel to have the option to
import the text in the way I have shown you in my previous message. I'm

using
XL 2003, Win XP too.

Do you think there is a way to add a statement to add this TEST IMPORT
WIZARD?.

Thanks in advance.
Maperalia


"Doug Glancy" wrote:

maperalia,

When I do it, the links are created and they work The files are opened

in
Visual Studio, and I'm prompted twice whether I really want to open them

but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default "lst" file does not work

Thanks very much for time Doug!. I really appreciatte it.

Maperalia

"Doug Glancy" wrote:

maperalia,

I'm sorry, I don't know the answer to your question.

Doug


"maperalia" wrote in message
...
Doug;
Thank for your quick response;
When I run the program the hyperlinks are created too. However, when I
click
on them I have nothing. No file is opened!
In addtion, I need to open these hyperlinks in excel to have the option to
import the text in the way I have shown you in my previous message. I'm
using
XL 2003, Win XP too.

Do you think there is a way to add a statement to add this TEST IMPORT
WIZARD?.

Thanks in advance.
Maperalia


"Doug Glancy" wrote:

maperalia,

When I do it, the links are created and they work The files are opened
in
Visual Studio, and I'm prompted twice whether I really want to open them
but
they do open. I'm using XL 2003, Win XP.

hth,

Doug


"maperalia" wrote in message
...
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****







Reply
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 04:59 PM.

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"