Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User prompt - Open file - Perform action


Hello,

I have a progam that performs certain database actions on a csv file
(f.x. transforms to excel, rearranges, copy-pastes, creates new
processed file).
For this to work i have up until now required the user to save this csv
file as a specified constant filename so that the code recognizes it.
The code is something like: Workbooks("csvfile.csv").activate. What i
would rather do is make some kind of prompt, where the user can choose
what file to process, a.k.a i want the user too choose from a standard
windows "open file" window, preferable with some kind of standard path.
When VBA has the opened this file, i think activesheet will be enough
the rest of the process. Do you have any suggestions?


--
erikhs
------------------------------------------------------------------------
erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=531857

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default User prompt - Open file - Perform action

Hi ,
Use Application.GetOpenFilename method so that user can browse the required
file

Thanks
Xcelion




"erikhs" wrote:


Hello,

I have a progam that performs certain database actions on a csv file
(f.x. transforms to excel, rearranges, copy-pastes, creates new
processed file).
For this to work i have up until now required the user to save this csv
file as a specified constant filename so that the code recognizes it.
The code is something like: Workbooks("csvfile.csv").activate. What i
would rather do is make some kind of prompt, where the user can choose
what file to process, a.k.a i want the user too choose from a standard
windows "open file" window, preferable with some kind of standard path.
When VBA has the opened this file, i think activesheet will be enough
the rest of the process. Do you have any suggestions?


--
erikhs
------------------------------------------------------------------------
erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=531857


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User prompt - Open file - Perform action


Thank you very much!

As i am lazy today, could you please tell me if i can have some default
folder to display?


--
erikhs
------------------------------------------------------------------------
erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=531857

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default User prompt - Open file - Perform action

chdrive "C"
Chdir "C:\MyFolder"
fname = Appliction.GetOpenFileName()

--
Regards,
Tom Ogilvy



"erikhs" wrote:


Thank you very much!

As i am lazy today, could you please tell me if i can have some default
folder to display?


--
erikhs
------------------------------------------------------------------------
erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=531857


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User prompt - Open file - Perform action


Thank you! As always this forum is fast and reliable!


--
erikhs
------------------------------------------------------------------------
erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788
View this thread: http://www.excelforum.com/showthread...hreadid=531857

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
%1 appears in "Application used to perform action" when trying to edit a file type [email protected] Excel Worksheet Functions 3 December 7th 06 07:00 PM
Prompt user to save their file Sharon[_5_] Excel Programming 4 September 29th 03 09:44 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


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