#1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 42
Default Redirecting


"Dave Peterson" wrote in message
...
You could have the macro reads a text file to get the name and then open
that
file.


that could work. Any idea how I might do that?


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default Redirecting

Option Explicit
Sub Auto_Open()

Dim TextLine As String
Open "C:\myfile.txt" For Input As #1
Line Input #1, TextLine
Close #1

Workbooks.Open Filename:=TextLine
ThisWorkbook.Close savechanges:=False

End Sub

You should add some validity checks to it.

C:\myfile.txt
is a plain old text file that contains one line of data--the full name of the
..csv file.



tishoo wrote:

"Dave Peterson" wrote in message
...
You could have the macro reads a text file to get the name and then open
that
file.


that could work. Any idea how I might do that?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 42
Default Redirecting


"Dave Peterson" wrote
C:\myfile.txt
is a plain old text file that contains one line of data--the full name of
the
.csv file.


Thanks - works great if c:\myfile.txt is a local file. Doesn't work if it is
a network file - like http://www.mywebspace.com/myfile.txt

Unfortunately needs to be network for users to access it.


  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default Redirecting

Maybe you can put it on a common network share. I don't speak the http stuff.

tishoo wrote:

"Dave Peterson" wrote
C:\myfile.txt
is a plain old text file that contains one line of data--the full name of
the
.csv file.


Thanks - works great if c:\myfile.txt is a local file. Doesn't work if it is
a network file - like http://www.mywebspace.com/myfile.txt

Unfortunately needs to be network for users to access it.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default Redirecting

Ps. You may want to give all the requirements in your original posts. Then
someone who actually knows how to help may jump in.

Dave Peterson wrote:

Maybe you can put it on a common network share. I don't speak the http stuff.

tishoo wrote:

"Dave Peterson" wrote
C:\myfile.txt
is a plain old text file that contains one line of data--the full name of
the
.csv file.


Thanks - works great if c:\myfile.txt is a local file. Doesn't work if it is
a network file - like http://www.mywebspace.com/myfile.txt

Unfortunately needs to be network for users to access it.


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 42
Default Redirecting


"Dave Peterson" wrote

Ps. You may want to give all the requirements in your original posts.
Then
someone who actually knows how to help may jump in.


Apologies. I took it for granted that it would have to be a network file.
You're right though - I should have been more detailed.

I think the only way to do this would be a minor variant on your first
ingenious suggestion. If I program the distributed sheet1.xls to open a
second on the network (www.myswebspace.com/sheet2.xls) which I can alter at
will. Sheet2.xls can, as you suggested, be programmed to open
www.mywebspace.com/data.csv file and then close itself.

My only problem then is how to auto-switch back to sheet1.xls once that
procedure is complete. Users don't want to see the csv file - it just needs
to be open.

Any ideas gratefully received.

T


  #7   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 42
Default Redirecting

I should add for completeness I have no idea what directory the users will
be installing sheet1.xls in.


  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.setup
external usenet poster
 
Posts: 35,218
Default Redirecting

Workbooks("Sheet1.xls").activate

Might do it.

tishoo wrote:

"Dave Peterson" wrote

Ps. You may want to give all the requirements in your original posts.
Then
someone who actually knows how to help may jump in.


Apologies. I took it for granted that it would have to be a network file.
You're right though - I should have been more detailed.

I think the only way to do this would be a minor variant on your first
ingenious suggestion. If I program the distributed sheet1.xls to open a
second on the network (www.myswebspace.com/sheet2.xls) which I can alter at
will. Sheet2.xls can, as you suggested, be programmed to open
www.mywebspace.com/data.csv file and then close itself.

My only problem then is how to auto-switch back to sheet1.xls once that
procedure is complete. Users don't want to see the csv file - it just needs
to be open.

Any ideas gratefully received.

T


--

Dave Peterson
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
Redirecting tishoo Excel Discussion (Misc queries) 12 December 27th 06 11:58 PM
redirecting personal.xls BorisS Excel Discussion (Misc queries) 5 December 5th 06 11:24 AM


All times are GMT +1. The time now is 08:11 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"