2 Replies - 706 Views - Last Post: 12 June 2013 - 04:55 AM Rate Topic: -----

#1 nighttrain  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 354
  • Joined: 22-September 10

Reduce Excel file

Posted 12 June 2013 - 12:25 AM

Hi there all,

After i generate output excel file sometimes it overrun 10 mb then i can't send it by the email in company because too big. I am wonder if there's any solution code to reduce size of excel from vb.net, do you have any idea? Best would be without using EXCEL interop maybe file.copy or something.

thanks

This post has been edited by nighttrain: 12 June 2013 - 12:34 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Reduce Excel file

#2 m_wylie85  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 96
  • View blog
  • Posts: 899
  • Joined: 15-October 10

Re: Reduce Excel file

Posted 12 June 2013 - 03:35 AM

You could try converting your .xls file(excel) to xml(If text based) or html or some other file format, or even just Zip the file. Put into google "reduce the size of an excel 2007" there is lot of tips out there for this.
Was This Post Helpful? 1
  • +
  • -

#3 nighttrain  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 354
  • Joined: 22-September 10

Re: Reduce Excel file

Posted 12 June 2013 - 04:55 AM

i've already find out fine solution with me which is working - after .xls file has been created i am using excel process to convert it to .xlsx which resize excel file even in 90 % dependes on specific excel file and what inside it. I am showing it for rest of searchers maybe it will help some of you, if any question just ask:

  string processFilePath = Environment.GetEnvironmentVariable("ProgramFiles") + @"\Microsoft Office\Office12\excelcnv.exe";
   string processArguments = "-oice \"" + fileName + "\" \"" + Path.GetDirectoryName(fileName) + @"\" + Path.GetFileNameWithoutExtension(fileName) + ".xlsx\"";
   Process process = new Process();
   process.StartInfo.FileName = processFilePath;
   process.StartInfo.Arguments = processArguments;
   process.Start();


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1