dear friends,
icreated small project to open excel using vb.
everything works fine with one exception. i used VB express 2010 in xp OS when developing the project. when it runs on the windows 7 platform the opening excel file goes behind the my application. the VB form topmost function is set to false but still the excel opens behind the application. anyways to get the excel as topmost? for your reference my coding is below.
Thanks.
TextBox1.Text = "" '(to empty up the search textbox to key in next excel file name )
Dim excel As New Microsoft.Office.Interop.Excel.Application
Dim wBook As Microsoft.Office.Interop.Excel.Workbook
Dim wSheet As Microsoft.Office.Interop.Excel.Worksheet
wBook = excel.Workbooks.Open(dgv1.CurrentRow.Cells(1).Value.ToString, False, True)
excel.Visible = True
'excel.WindowState = XlWindowState.xlMaximized
With excel
.DisplayFullScreen = True
.CommandBars("Full Screen").Visible = False
.CommandBars("Worksheet Menu Bar").Enabled = False
End With