Consulting

Results 1 to 2 of 2

Thread: Save as csv

  1. #1

    Save as csv

    Hi All,

    I have the following code (part of it) which works fine on my Office 2010, but kicks out an error message on a colleague's machine who has Office 2007. Can anyone assist with a tweak for Excel 2007, i.e. how to save a worksheet as csv in 2007.

     	Workbooks("Journal Upload.xls").Worksheets("Sheet1").SaveAs Filename:="C:\Users\Tony\Journal Upload.csv", FileFormat:=xlCSVWindows
    Also, after running this macro a number of times, my Excel seems to have slowed and keeps shutting down. I know there is some sort of a cache clean up procedure which could help, can anyone shed any light?

    Thanks

    H

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    What if you save the workbook instead of the worksheet ?

    instead of

    [vba]
    Workbooks("Journal Upload.xls").Worksheets("Sheet1").SaveAs
    [/vba]

    [vba]
    Workbooks("Journal Upload.xls").SaveAs
    [/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •