Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Macro not saving properly? Can't see problem

I made a macro that formats an excel document. I import information
into excel then format it to export to another company. I made the
macro save the workbook onto the outgoing server as a .csv file. The
other company's system then automatically comes and picks up the saved
workbook and puts it into their system.

Here is my code:

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 5/31/2006 by UnumProvident Corporation
'

'
ActiveWorkbook.SaveAs Filename:= _
"O:\UA\UAna\NA_Outsourcing_Administration\Tenet\Re ports\2006
Weekly reports\full reports\week ending." & Format(Now(),
"mm-dd-yyyy.") & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("N:P").Select
Selection.Delete Shift:=xlToLeft


Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Closed"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="New"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="req complete"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Missing Info"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Pending"
Cells.Select
Selection.Delete Shift:=xlUp
Columns("I:I").Select
ActiveWorkbook.SaveAs Filename:= _

"B:\Hewitt\TenetHealthCare\NA\LIF\Out\BAS05980.P.E FT.EOIIN.UNUMLIF.csv",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

ActiveWorkbook.SaveAs Filename:= _
"O:\UA\UAna\NA_Outsourcing_Administration\Tenet\Re ports\2006
Weekly reports\reports to server\BAS05980.P.EFT.EOIIN.UNUMLIF" &
Format(Now(), "mm-dd-yyyy") & ".csv", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False



End Sub

This section:

ActiveWorkbook.SaveAs Filename:= _

"B:\Hewitt\TenetHealthCare\NA\LIF\Out\BAS05980.P.E FT.EOIIN.UNUMLIF.csv",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

Is what saves the file to the server to be picked up.

This is what the company says they are getting:


[ ]



)

_ V B A _ P R O J E C T _ C U R "

F

d { d V B A





"#,##0.00_);Red\("$"#,##0.00\) 7 * 2 _("$"* #,##0_);_("$"*
\(#,##0\)


769-10-1114 EE MANUEL-BAILLY
SA
a e

d MbP?_ * +
%




~

l@

I can not imagine what is causing this. If I look at the file once it
is placed on the server it looks like a normal CSV file. Is there
something I have done wrong in my code that makes this crazyness show
up?

Thanks!
Mary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Macro not saving properly? Can't see problem

You have
FileFormat = xlNormal
which meand that it is saving the file as a spreadsheet. When you open it
you are seeing the binary file of the spreadsheet. Try changing that to

FileFormat = xlCSV
--
HTH...

Jim Thomlinson


" wrote:

I made a macro that formats an excel document. I import information
into excel then format it to export to another company. I made the
macro save the workbook onto the outgoing server as a .csv file. The
other company's system then automatically comes and picks up the saved
workbook and puts it into their system.

Here is my code:

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 5/31/2006 by UnumProvident Corporation
'

'
ActiveWorkbook.SaveAs Filename:= _
"O:\UA\UAna\NA_Outsourcing_Administration\Tenet\Re ports\2006
Weekly reports\full reports\week ending." & Format(Now(),
"mm-dd-yyyy.") & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("N:P").Select
Selection.Delete Shift:=xlToLeft


Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Closed"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="New"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="req complete"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Missing Info"
Cells.Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Insert Shift:=xlDown

Columns("I:I").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="Pending"
Cells.Select
Selection.Delete Shift:=xlUp
Columns("I:I").Select
ActiveWorkbook.SaveAs Filename:= _

"B:\Hewitt\TenetHealthCare\NA\LIF\Out\BAS05980.P.E FT.EOIIN.UNUMLIF.csv",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

ActiveWorkbook.SaveAs Filename:= _
"O:\UA\UAna\NA_Outsourcing_Administration\Tenet\Re ports\2006
Weekly reports\reports to server\BAS05980.P.EFT.EOIIN.UNUMLIF" &
Format(Now(), "mm-dd-yyyy") & ".csv", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False



End Sub

This section:

ActiveWorkbook.SaveAs Filename:= _

"B:\Hewitt\TenetHealthCare\NA\LIF\Out\BAS05980.P.E FT.EOIIN.UNUMLIF.csv",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

Is what saves the file to the server to be picked up.

This is what the company says they are getting:


¡µ [áÄ ]



)

_ V B A _ P R O J E C T _ C U R "

úF

dÓþ ú{ dÓþ V B A





"#,##0.00_);ÝRed¨\("$"#,##0.00\) 7 * 2 _("$"* #,##0_);_("$"*
\(#,##0\)
Ó Ù ý

769-10-1114 EE MANUEL-BAILLY
SA
a Æ ªÌ ¿ e

d ÙëÿÐMbP?_ * +
%




~

l@Ú

I can not imagine what is causing this. If I look at the file once it
is placed on the server it looks like a normal CSV file. Is there
something I have done wrong in my code that makes this crazyness show
up?

Thanks!
Mary


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
Problem with saving Excel Template opened in macro KelliInCali Excel Programming 2 September 5th 06 08:00 PM
Excel file not saving properly Noma Jane Dill Excel Discussion (Misc queries) 3 August 29th 06 11:44 PM
Excel file not saving properly Noma Jane Dill Excel Discussion (Misc queries) 2 August 26th 06 06:26 AM
macro saving problem tweacle Excel Worksheet Functions 0 December 27th 05 12:29 PM
Can't get CF to work properly, Active Cell problem? Yogi_Bear_79 Excel Programming 7 June 7th 05 06:52 PM


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