LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Save as

Hi Tom
thanks for the info, didn't see that other posting :-)

--
Regards
Frank Kabel
Frankfurt, Germany

Tom Ogilvy wrote:
Edgar said it was fixed in a later posting in a related thread.


"Edgar" wrote in message
...
Hi

Thanks for this, i have used this and it worked fine the
first time i used it and now it is coming up with the
following error.

Compile error: Wrong number of arguments or invalid
property assignment!!

Any ideas

Sub WebImport()

Dim hLink As String
Dim hname As String
Dim i As Long
Dim fname As String

'fname = "C:\Documents and Settings\ThoemmE1
\Desktop\Shares\Web Query Data\UK Shares by Sector\" &
Format(Date, "dd-mmm-yy") & ".xls"
fname = "C:\Documents and Settings\ThoemmE1
\Desktop\Shares\Web Query Data\UK Shares by Sector\" &
Format(Date, "dd-mmm-yy") & ".xls"

For i = 1 To 98 Step 1
hLink = Worksheets("Index").Cells(i, 2).Text
hname = Worksheets("Index").Cells(i, 1).Text

'Worksheets.Add
Worksheets.Add After:=Worksheets(Worksheets.Count)

With ActiveSheet.QueryTables.Add(Connection:="URL;" &
hLink, _
Destination:=Range("A1"))
.Name = "news.bbc.co.uk"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "11"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False

End With
ActiveSheet.Name = hname
Columns("D:M").NumberFormatLocal = "0.00_ "
Rows("3:5").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft

Next i

ActiveWorkbook.saveas Filename:=fname

End Sub

-----Original Message-----
Hi
try
dim fname as string
fname = "C:\Documents and Settings\ThoemmE1 \Desktop\Shares\Web
Query Data\UK Shares by Sector\" &Format(Date, "dd-mmm-yy")

& ".xls"
ActiveWorkbook.SaveAs filename:=fname

--
Regards
Frank Kabel
Frankfurt, Germany

Edgar wrote:
What is wrong with the following line of code?

I would like it to save a copy of the current workbook

to
the directory listed with the name as todays date
formatted dd-mmm-yy

TIA

ActiveWorkbook.saveas ("C:\Documents and Settings\ThoemmE1
\Desktop\Shares\Web Query Data\UK Shares by Sector\" &
Format(Date, dd-mmm-yy) & ".xls")

.



 
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
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
when i save xls file, debug script is running and canno't save fil Imtiaz Excel Discussion (Misc queries) 1 July 16th 05 03:47 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM


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