#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default open file

I want to create a code that at the press of a button will allow the user to
search for a file and open it. When the file is open I want to be able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default open file

You can start with Application.getOpenFilename.
Once you have opened file, record a macro of your step.
Put them together and lets us if it's working.

NickHK

"enyaw" wrote in message
...
I want to create a code that at the press of a button will allow the user

to
search for a file and open it. When the file is open I want to be able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default open file

I want to be able to open any file. The code "Application.getOpenFilename"
only opens the open file window but i cannot open any of the files from
there. The excel workbook that will use this code is a sort of template that
has a user form allowing to add and edit the data. After the user opens the
file i want to be able to automatically copy the contents of that file into
the template.

"NickHK" wrote:

You can start with Application.getOpenFilename.
Once you have opened file, record a macro of your step.
Put them together and lets us if it's working.

NickHK

"enyaw" wrote in message
...
I want to create a code that at the press of a button will allow the user

to
search for a file and open it. When the file is open I want to be able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default open file

"Application.GetOpenFilename" allows you to get the path/filename of any
file.
You then have to .Open (or do whatever you want) the file yourself.
The Help file has an example.

NickHK

"enyaw" wrote in message
...
I want to be able to open any file. The code

"Application.getOpenFilename"
only opens the open file window but i cannot open any of the files from
there. The excel workbook that will use this code is a sort of template

that
has a user form allowing to add and edit the data. After the user opens

the
file i want to be able to automatically copy the contents of that file

into
the template.

"NickHK" wrote:

You can start with Application.getOpenFilename.
Once you have opened file, record a macro of your step.
Put them together and lets us if it's working.

NickHK

"enyaw" wrote in message
...
I want to create a code that at the press of a button will allow the

user
to
search for a file and open it. When the file is open I want to be

able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default open file

i used "Application.FindFile" to open the other file. Is there any way of
copying the information from the open file into the template after the file
is found? I want to be able to open the file copy the information into the
template and and close the file at the touch of a button. The filename will
not be the same which is what is making it difficult for me.

"NickHK" wrote:

"Application.GetOpenFilename" allows you to get the path/filename of any
file.
You then have to .Open (or do whatever you want) the file yourself.
The Help file has an example.

NickHK

"enyaw" wrote in message
...
I want to be able to open any file. The code

"Application.getOpenFilename"
only opens the open file window but i cannot open any of the files from
there. The excel workbook that will use this code is a sort of template

that
has a user form allowing to add and edit the data. After the user opens

the
file i want to be able to automatically copy the contents of that file

into
the template.

"NickHK" wrote:

You can start with Application.getOpenFilename.
Once you have opened file, record a macro of your step.
Put them together and lets us if it's working.

NickHK

"enyaw" wrote in message
...
I want to create a code that at the press of a button will allow the

user
to
search for a file and open it. When the file is open I want to be

able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default open file

Yes, recorder a macro of your copy actions and add it after the .FindFile
code.

NickHK

"enyaw" wrote in message
...
i used "Application.FindFile" to open the other file. Is there any way of
copying the information from the open file into the template after the

file
is found? I want to be able to open the file copy the information into

the
template and and close the file at the touch of a button. The filename

will
not be the same which is what is making it difficult for me.

"NickHK" wrote:

"Application.GetOpenFilename" allows you to get the path/filename of any
file.
You then have to .Open (or do whatever you want) the file yourself.
The Help file has an example.

NickHK

"enyaw" wrote in message
...
I want to be able to open any file. The code

"Application.getOpenFilename"
only opens the open file window but i cannot open any of the files

from
there. The excel workbook that will use this code is a sort of

template
that
has a user form allowing to add and edit the data. After the user

opens
the
file i want to be able to automatically copy the contents of that file

into
the template.

"NickHK" wrote:

You can start with Application.getOpenFilename.
Once you have opened file, record a macro of your step.
Put them together and lets us if it's working.

NickHK

"enyaw" wrote in message
...
I want to create a code that at the press of a button will allow

the
user
to
search for a file and open it. When the file is open I want to be

able to
copy the contents of sheet1 into another workbook called "product
calculator". Anybody got any ideas?








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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


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