Question insert object & textbox in single cell in excel

sweish

New member
Joined
May 20, 2010
Messages
4
Programming Experience
Beginner
I need to place a object & a textbox with some value in a single cell in excel through vb.net. This is the code i have followed,

xlWorkSheet.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 50, 50, 10, 25).TextFrame.Characters.Text = "56"


Dim ms As New System.IO.MemoryStream
Dim oIMage As Image = Image.FromFile("C:\Documents and Settings\swetha\Desktop\a.bmp")
oIMage.Save(ms, oIMage.RawFormat)
Dim arrImage() As Byte = ms.GetBuffer
Dim integralLogo As Bitmap = CType(Image.FromStream(ms), Bitmap)
Clipboard.SetDataObject(integralLogo)

xlRange = xlWorkSheet.Range(xlWorkSheet.Cells(1, 1), xlWorkSheet.Cells(1, 1))
xlWorkSheet.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 2.5, 1.5, 116, 145).TextFrame.Characters.Text = "56"




xlRange.Select()
xlWorkSheet.Paste()
xlWorkSheet.SaveAs("C:\Documents and Settings\swetha\Desktop\dfg02.xlsx")


By this i was able to place both in single cell but they are getting overlapped. I need object on the top and textbox in the bottom. How to get the properties of the textbox like the textbox should be in bottom or left or right of the cell?


Thanks,
ishu.
 
Back
Top