View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Repost for additional information

Maybe:

option explicit
sub testme01()

dim wks as worksheet
dim actWkbk as workbook

set actwkbk = activeworkbook
with actwkbk
.worksheets("table").copy
end with

set wks = activesheet 'in the new workbook
with wks.usedrange
.value = .value
end with
wks.parent.saveAs "\\your unc path"
wks.parent.saveas "yourmapped path"
wks.parent.sendmail recipients:=array("hi","there")
'no need to copy it again
wks.parent.saveas "\\unc\" & ... & ".csv, fileformat:=xlcsv
wks.parent.close savechanges:=false
actwkbk.activate

end sub

Watch for typos.
ScreenUpdating = False
Worksheets("Table").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\Table" & Range("B56") &
".xls"
ActiveWorkbook.SaveAs "g:\data\table" & Range("B56") & ".xls"
ActiveWorkbook.SendMail Recipients:=Array("My distribution list")
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\Table" & Range("B56")"
& Range("B56")
& ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

Henry wrote:

Hello,
Sorry for the repost but the my OP got buried last week and Im still confused....

I am saving one sheet Table! from my spreadsheet as an .xls and also as .csv with the following code....

ScreenUpdating = False
Worksheets("Table").Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\Table" & Range("B56") & ".xls"
ActiveWorkbook.SaveAs "g:\data\table" & Range("B56") & ".xls"
ActiveWorkbook.SendMail Recipients:=Array("My distribution list")
ActiveSheet.Copy
ActiveWorkbook.SaveAs "\\Dfs01\shares\Groupdirs\0535\Table" & Range("B56")" & Range("B56") & ".csv", FileFormat:=xlCSV
ActiveWorkbook.Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=False
ScreenUpdating = True

End Sub


In the save I want to save just the values no links, no macros, etc
Don Guillett (Not Bob) Graciousliy provided the following code to accomplish this but I have tried adding it in several places and cant get it to work. Where do I need to put it in my original code?

With ActiveSheet.UsedRange
..Value = .Value
End With

Thanks!
Henry


--

Dave Peterson