Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default SaveAs to existing file

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default SaveAs to existing file

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default SaveAs to existing file

Hi "Gary" Student,

Thank you so much - Your answer solved my problem.

Best regards
Jan holmstrom

"Gary''s Student" skrev:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default SaveAs to existing file

Glad to help.
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi "Gary" Student,

Thank you so much - Your answer solved my problem.

Best regards
Jan holmstrom

"Gary''s Student" skrev:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default SaveAs to existing file

Don't forget to turn DisplayAlerts back on:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Sub

"Gary''s Student" wrote in message
...
Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for
accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default SaveAs to existing file

Hi Doug,
Thanks for the warning. My macro only runs within the workbook, and it
dosn't effect other workbooks.
Best regards
Jan Holmstrom

"Doug Glancy" skrev:

Don't forget to turn DisplayAlerts back on:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Sub

"Gary''s Student" wrote in message
...
Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "C:\test\"
Workbooks.Open Filename:= _
"Contact_List.html"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
--
Gary''s Student - gsnu200834


"Jan Holmstrom" wrote:

Hi,

My macro opens a htm file with data and save it to an existing xls file
(2003).

When it runs - I'm asked to accept overwriting the existing file.

Is it possible to make the same rutine - without Excel asking for
accept?

My code:

Sub HTMTOEXCL()
'
' HTMTOEXCL Makro
' Makro indspillet 15-02-2009 af Jan Holmstrøm
'
ChDir "my path"
Workbooks.Open Filename:= _
"my file.htm"
ActiveWorkbook.SaveAs Filename:= _
"existing file.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

Best regards




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
Allowing xlBook.SaveAs in Access code to overwrite existing workbook? Ed from AZ Excel Programming 2 January 26th 08 08:16 PM
SaveAs macro: How do I specify "Replace existing file?" [email protected] Excel Programming 1 May 24th 05 02:36 AM
Using SaveAs Statement to overwrite existing File Peter Excel Programming 3 June 16th 04 12:27 PM
Saveas on Template retains existing name! Brent Fidler Excel Programming 0 May 21st 04 10:00 PM
Templaste SaveAs retains existing name Brent Fidler Excel Programming 0 May 18th 04 05:58 PM


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