LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
JHH JHH is offline
external usenet poster
 
Posts: 2
Default Query file without copy inside Excel

I discover I can't attach the FStrunc0.xls file with its macro to do the
refresh and the failing delete querytables, so I paste the macro here :

Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 12.09.2009 par P-1
'
' Touche de raccourci du clavier: Ctrl+m
'
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;E:\Shared\FSdata\fs-b2.iqy", Destination:=Range("A1"))
.Name = "fs-b2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
ActiveWorkbook.Sheets("Feuil1").QueryTables("fs-b2_1").Delete
End Sub

And the iqy-file content :

WEB
1
http://futuresource.quote.com/quotes...chg%2Cdatetime

Selection=19
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False

I hope this makes it clearer what a really simple task I'm trying to
acomplish (at least as a first step)
--
JHH


"Don Guillett" wrote:

What is the url? Have you tried an external query instead of the iqy?
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You send a clear explanation of what you want
3. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JHH" wrote in message
...
I have a rather long URL-query in a file, "353.iqy". (The URL contains 353
characters)
I have let excel2000 write a macro which launches this query.
Unfortunately
the resulting sheet saves the query inside itself under an ever
'increasing'
name . For the moment I manually go to external data , properties of
table,
then unhatch the save the query and 'force' it to accept that, but next
time
the internal name has become 353_2 f.inst. then next time 353_3 etc. which
means that the continuation of the macro that erases this query-table and
saves the file without macro and without query, just the data, cannot just
delete the query (as it has changed name).

Is it possible to include something in the query-file to avoid saving a
copy
'inside' under a changed name ?

I tried of course to edit the inside file and no longer use the 353.iqy on
disk, but that often did not work because it exceeds the 254 character
length
that excel readily accepts.
It seemed to work when started manually, but when started by scheduler at
the appropriate time it often failed.

Is this 254 character limit the same in excel2003 and 2007 ?

--
Yern



 
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
add the macros contained inside a template to an Excel file. Aerojade Excel Discussion (Misc queries) 1 September 30th 08 05:53 AM
Query refreshing inside a loop - out of memory JU Excel Programming 2 February 8th 08 11:09 PM
Copy/Paste charts as object inside excel Khoshravan Charts and Charting in Excel 1 September 17th 07 02:54 PM
get file name inside a macro on Excel Get a file name inside a macro Excel Worksheet Functions 2 October 17th 06 10:33 PM
Execute a batch file from inside Excel Eric[_14_] Excel Programming 2 November 12th 03 05:21 PM


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