In my last post, I was able to find out how to add a picture to an Excel document from VB.NET.
VB Code:
Dim pic As String = "filelocation/exactfilename.jpg" oSheet.Range("B1:B1").Select() 'Where you want picture top left corner to be oXL.ActiveSheet.Pictures.Insert(pic)
What if I have multiple Excel doc's I am creating and the picture needs to be a different size on each one?
In VB6, I did it this way - which does not work so well in .NET.
VB Code:
objexcel.ActiveSheet.Pictures.Insert(App.Path & logotext).Select objexcel.Selection.ShapeRange.ScaleWidth 0.15, msoFalse, msoScaleFromTopLeft objexcel.Selection.ShapeRange.ScaleHeight 0.15, msoFalse, msoScaleFromTopLeft
I am having a lot of trouble understanding how Excel works with the newer .NET language. Slowly buy surely I am figuring this out... with the help of everyone on VB Forums.
Thank you in advance for your time and assistance.




Reply With Quote