Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default open file dialog-select file-import worksheet

Can someone help me? I am able to do this in access but seem to can't get it to work in excel

What I would like to do is open a file dialog and select a file (generic/any file) and when that file is selected, the worksheet within the file selected is imported or copied into a file that is already opened

In other words, I have an automated form that I have created and the worksheet within the file that is selected, that worksheet is imported or copied into the file next to the automated form

Thank you in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default open file dialog-select file-import worksheet

Dim fName as String
Dim wkbk as Workbook
fName = Application.GetOpenFileName()
if fName < "False" then
set wkbk = Workbooks.Open(fName)
wkbk.Worksheets(1).Copy After:=ThisWorkbook.Worksheets( _
ThisWorkbook.Worksheets.count)
wkbk.close SaveChanges:=False
End if

--
Regards,
Tom Ogilvy


"Divinedar" wrote in message
...
Can someone help me? I am able to do this in access but seem to can't get

it to work in excel.

What I would like to do is open a file dialog and select a file

(generic/any file) and when that file is selected, the worksheet within the
file selected is imported or copied into a file that is already opened.

In other words, I have an automated form that I have created and the

worksheet within the file that is selected, that worksheet is imported or
copied into the file next to the automated form.

Thank you in advance for your help.



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
Skipping Import Text File dialog in a Macro Leon Excel Discussion (Misc queries) 5 January 21st 08 09:12 PM
How come I can't import an .svc file(Open Office) to Excel file? beezer Excel Discussion (Misc queries) 1 August 28th 06 12:05 AM
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 10:42 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"