Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sridaran Sriram

@Sridaran Sriram
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Excel file format saving as XMLSpreadsheet [modified]
    S Sridaran Sriram

    For opening a file, you don't need a file format. So you dont have to give a value. But the catch is this method does not allow nulls. Hence the work around is create a missing variable and send it as parameter. Or just give this System.Reflection.Missing.Value and try.

    C# help xml

  • Excel file format saving as XMLSpreadsheet [modified]
    S Sridaran Sriram

    Hi, I have to insert a logo in the excel file which is created using CreateText() method of file stream. After writing XML data in the file, I open the excel to insert a logo at the end. It is opening the excel and pasting the logo perfectly. But the problem is it is not saved properly. I have given my code below. Excel.Application excelApplication = null; Excel._Workbook workbook; excelApplication = new Excel.ApplicationClass(); string fname = "D:\\datapointlogo.bmp"; object missing = System.Reflection.Missing.Value; excelApplication.Visible = true; excelApplication.UserControl = true; workbook = excelApplication.Workbooks.Open(fileName, missing, missing, 5 , missing, missing , missing, missing, missing, missing, missing, missing, missing, missing, missing); Excel.Worksheet ThisSheet = (Excel.Worksheet)workbook.Sheets[1]; Excel.Range oRange = (Excel.Range)ThisSheet.Cells[35, 1]; Image oImage = Image.FromFile(fname); oRange.set_Item(35, 1, oImage); System.Windows.Forms.Clipboard.SetDataObject(oImage, true); ThisSheet.Paste(oRange, fname); workbook.Save(); After opening the excel file, I noticed that, File format for this excel is XMLSpreadsheet. I tried to manually change the file format in the Save As dialog and it worked fine. Also, Please note that, I don't want to use the following line though it works fine. workbook.SaveAs(fileName, Excel.XlFileFormat.xlExcel8, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, Excel.XlSaveAsAccessMode.xlNoChange, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value); I have to change the file format without using SaveAs method. Please help me. Thanks, S.Sriram.

    modified on Monday, November 17, 2008 4:02 AM

    C# help xml
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups