Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to specify the filename

i use this macro to import data from a worbook


Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=Αρχεία Excel;DBQ=D:\MY
WORKBOOK.xls;DefaultDir=D:;DriverId=790;MaxBufferS ize=20480;PageTimeout=5;"
_
, Destination:=Range("A1"))
..CommandText = Array( _
"SELECT `MY SHEET$`.F1, `MY SHEET$`.F3, `MY SHEET$`.F4, `MY
SHEET$`.F5, `MY SHEET$`.F6, `MY SHEET$`.F8, `MY SHEET$`.F9, `MY
SHEET$`.F10, `MY SHEET$`.F11, `α" _
, _
"γωνιστικές10$`.F13" & Chr(13) & "" & Chr(10) & "FROM
`D:\ΟΜΙΛΟΣ 1Γ ΚΑΤΗΓΟΡΙΑΣ`.`MY SHEET$` `MY SHEET$`" _
)
..Name = "N A M E"
..FieldNames = True
..RowNumbers = False
..FillAdjacentFormulas = False
..PreserveFormatting = True
..RefreshOnFileOpen = False
..BackgroundQuery = True
..RefreshStyle = xlInsertDeleteCells
..SavePassword = True
..SaveData = True
..AdjustColumnWidth = True
..RefreshPeriod = 0
..PreserveColumnInfo = True
..Refresh BackgroundQuery:=False
End With
End Sub

I want the user to choose the workbook.How can i do it.
Thanks in advance.


---
Message posted from http://www.ExcelForum.com/

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
filename.xls:1 and filename.xls:2 Christina C. Excel Discussion (Misc queries) 7 November 27th 07 10:39 PM
Filename safety Jeff Excel Discussion (Misc queries) 1 November 5th 07 02:54 PM
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
+ in filename mkrefting Excel Discussion (Misc queries) 0 October 24th 06 07:44 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"