Click here to Skip to main content
15,867,765 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi, i am trying a open file dialog to bring a excel file in my program in run time
but err comes "be shure about query string and memory "
OFGESelectfile3
is renamed
open file dialo

and filter is
JPEG Files| *.JPG|GIF Files|*.GIF|Windows Bitmaps|*.BMP|Excel fiels|*.xlsx


What I have tried:

Private Sub cmdaddexl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdaddexl.Click
       If OFGESelectfile3.ShowDialog = Windows.Forms.DialogResult.OK Then
           PictureBox1.Image = Image.FromFile(OFGESelectfile3.FileName)
       End If
   End Sub
Posted
Updated 1-Jun-17 5:10am
Comments
Dave Kreskowiak 1-Jun-17 11:09am    
That's not an error message or even something that the framework would throw.

We need the EXACT error message in order to figure out what's wrong. Hit the "Improve Question" button and copy and paste the exact error into your question.
yogesh vaidya 2-Jun-17 0:19am    
If you are creating an array, make sure the size is correct.
For more information, Visual Basic users can see Arrays in Visual Basic.
For more information, C# users can see Arrays (C# Programming Guide).
Be sure you have enough memory for internal purposes and new managed objects.
If you are programming on the .NET Compact Framework, the common language runtime throws this exception when there is not enough memory for internal purposes or new managed objects. To prevent the exception, avoid programming large methods that consume 64 or more kilobytes of memory.

1 solution

Wait a second. You're trying to get a PictureBox control to load an Excel workbook as an Image? Yeah, that's not going to work. The PictureBox control has no idea what to do with an Excel workbook.

If you're trying to show an Excel sheet in a Windows Forms Form, it's considerably more complicated than the code you've shown. integrate excel in windows form application[^]
 
Share this answer
 
v2
Comments
yogesh vaidya 2-Jun-17 0:22am    
sir ,thanking you very much about your help ,
but i am not working on website i am just developing a office software for my own use in visual basic
sir please give me some Ida what is the replacement of picture Box for Excel work sheet.
Dave Kreskowiak 2-Jun-17 7:54am    
Where did I mention anything about a website?

My answer still stands.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900