command to import a file into excel
i have made an excel file wherein i hve a command button and when
click that command button, a common dolog box opens and i select a tex file, now i have selected a text file, i want to import it int excel,,how would i do that i have attached the file... please let me know thank Attachment filename: vikrama.xls Download attachment: http://www.excelforum.com/attachment.php?postid=54352 -- Message posted from http://www.ExcelForum.com |
command to import a file into excel
assume the variable fname holds the fully qualified path as returned by your
common dialog. Workbooks.Open Filename:=fname If you want special treatment of the text file, look at Workbooks.OpenText Filename:=fname, . . . additional arguments - see help . .. . -- Regards, Tom Ogilvy "vikram " wrote in message ... i have made an excel file wherein i hve a command button and when i click that command button, a common dolog box opens and i select a text file, now i have selected a text file, i want to import it into excel,,how would i do that i have attached the file... please let me know thanks Attachment filename: vikrama.xls Download attachment: http://www.excelforum.com/attachment.php?postid=543522 --- Message posted from http://www.ExcelForum.com/ |
command to import a file into excel
Sorry, if you want to import it into an existing document, turn on the macro
recorder while you manually do Data=Get External Data = Import Text file and import a text file. Then turn off the macro recorder and replace the hardcoded file name with the variable fName or whatever variable holds the fully qualified name of the file. -- Regards, Tom Ogilvy "vikram " wrote in message ... i have made an excel file wherein i hve a command button and when i click that command button, a common dolog box opens and i select a text file, now i have selected a text file, i want to import it into excel,,how would i do that i have attached the file... please let me know thanks Attachment filename: vikrama.xls Download attachment: http://www.excelforum.com/attachment.php?postid=543522 --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 08:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com