|
|
Hi Abhinav,
I have already gone through the link provided in your reply. However, there are some issues that I have with the steps provided.
I am using VS.NET 2003 / Windows XP / Office 2003
In the following steps,
Dim excelApp As New Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add
Dim excelWorksheet As Excel.Worksheet = _
CType(excelBook.Worksheets(1), Excel.Worksheet)
I have added a reference to Excel 10.0 Object. However, it displays error message for the above code.
For the line, Dim excelApp As New Excel.Application, the options provided is _Application.
Also for, Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add, there is no workbooks.add property available.
Can you help me out with this. It is very important for me. Thnx a lot for your concern.
With Best Regards,
Mayur
|
|
|
|
|
i did it like this:
Dim excelApp As Object<br />
Dim excelBook As Object<br />
' to Workbook to Worksheet.<br />
excelApp = CreateObject("Excel.Application")<br />
excelBook = excelApp.Workbooks.Add<br />
Dim excelWorksheet = excelBook.worksheets(1)<br />
excelApp.Visible = True
try it
abhinav
|
|
|
|
|
I have a listbox which can multiple select.
How can I get the newest selectItem ?
I means I have already select 2 item, how can I get the last item i selected?
Suppose the user may random select.
|
|
|
|
|
'Declare a form level variable as
Inherits System.Windows.Forms.Form
Private lstLastItem As Integer
'Move the index of selected item of list box into the lstLastItem
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
lstLastItem = ListBox1.SelectedIndex
End Sub
|
|
|
|
|
<br />
lstLastItem = ListBox1.SelectedIndex<br />
SelectedIndex seems always return the smallest one.
Not that Laterest one.
That is when I select index 0 item and then select index 1 item,
It also return index 0 but not the laterest index 1...
anyway, Thank you
|
|
|
|
|
'Declare a form level variable as
Inherits System.Windows.Forms.Form
Private lstLastItem As Integer
'Move the index of selected item of list box into the lstLastItem
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
lstLastItem = ListBox1.SelectedIndex
End Sub
lstLastItem will contain the last index if u want to access the last selected item u may access it as
MsgBox(ListBox1.Items.Item(lstLastItem))
|
|
|
|
|
Hello All,
i have made a windows application in vb.net and developed reports in crystal reports which is in visual studio.
Then i installed my application on 42 different locations. In these 35 locations are generating the printout of the reports from their default printer. But 7 locations are generating this error:CrystalDecisions.CrystalReports.Engine.FormatEngine: "Invalid printer specified."
Can anybody help me how to solve it.
misecprj
|
|
|
|
|
Your best bet is to Google for "Crystal Reports Invalid Printer Specified", and you'll come up with lots of hits, and lots of hints. All you have to do is start reading and see what fits your codes situation.
Here's[^] a freebie to get you started.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
what is the size of Windows form when it is in maximized state, as in the height and width of the form?
With Best Regards,
Mayur
|
|
|
|
|
Form Height and Width Depends on the Screen Setting.
For 1027 x 868
The height = 748 and width = 1032
For 800 x 600
The height = 580 and width = 808
Regards
|
|
|
|
|
Thnx Javed, for 1024 x 768 it is (1036, 780). Thnx A Lot !!!
With Best Regards,
Mayur
-- modified at 0:46 Thursday 19th January, 2006
|
|
|
|
|
Hi everyone I am trying to compare userid i.e, if the user exists I want to display the message.I am getting error when comparing the text in the textbox and the text from the database.Please tell me how to convert the value into string. the code is as follows...
cmd.commandtext="select user from reg"
da.selectcommand=cmd
da.fill(ds,"reg")
for each dr in ds.tables("reg").rows
If textbox1.text=dr.item(0) then
msgbox("UserExists")
endif
next
thanxin advance
yamini
|
|
|
|
|
may be "user" field have null values thats y it will be giving error
Try this:
cmd.commandtext="select user from reg"
da.selectcommand=cmd
da.fill(ds,"reg")
for each dr in ds.tables("reg").rows
If textbox1.text= (dr.item(0) & "") then
msgbox("UserExists")
endif
next
|
|
|
|
|
The data you get from dr.item(0) is of the type Object. That means that you are comparing the values as objects, not strings, and as they are not the same object, the expression never will be true.
Convert the object to a string:
If textbox1.text = dr.item(0).ToString() then
---
b { font-weight: normal; }
|
|
|
|
|
I'm fairly new to programmimg and I'm also a 20-year musician. I'm trying to create a pitch tuning program for when I'm tuning my guitar. I have buttons that when clicked will play the correct pitch and I have images set up to display an image of the corresponding guitar string. I would like for both to occur at the same time, but the audio wave will play first and when its done it then diplays the image. Is there any way to have both occur at the same time? Also, how can I interrupt the audio playback once its begun? Thanks to those who respond. I've tried and read and I can't seem to go in the right direction.
Richard
|
|
|
|
|
You can do one of two things. First, use an asyncronous method of playing audio ( i.e. one where you tell it to play and the app does not wait ), and two - play audio in another thread.
How you interupt the audio depends entirely on how you play it. If you were to use WMP as a control, then you could interact with it. If you use a PlaySound type API then you're out of luck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
my problem is that,,,,if i check my checkbox in a runtime,it will not appear to the to the datagrid,,,supposed to be there is a check there,,can you help me to solve this problem
neobags
|
|
|
|
|
Im getting System.OverflowException, with a very large number for OwnerhWnd
I have:
<br />
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br />
Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long<br />
and in load method of mainform,
<br />
Dim OwnerhWnd As Integer<br />
Dim ret As Integer<br />
Dim hWnd As Long<br />
hWnd = FindWindow("MainForm", "")<br />
OwnerhWnd = GetWindow(hWnd, GW_OWNER)<br />
Anyone tell me whats wrong here?
I want to do that so I can call
ret = ShowWindow(OwnerhWnd, SW_HIDE)
but crashing on line OwnerhWnd = GetWindow(hWnd, GW_OWNER)
thanks
|
|
|
|
|
The .Handle property of a Form is the HWND.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks, instead of all that other stuff, I only needed
<br />
Dim OwnerhWnd As Long<br />
OwnerhWnd = Me.Handle.ToInt64<br />
' Hide from task list:<br />
Call ShowWindow(OwnerhWnd, SW_HIDE)<br />
to achieve what I wanted
|
|
|
|
|
And the overflow problem was because I used ret as Int rather then Int64
|
|
|
|
|
Why are you expecting a return type of Long?? Long is 64 bits on a 32 bit proc and 128 bits wide on a 64 bit proc.
Any function that returns a handle returns a value the same as the data width for the processor it's running on. The proper return type for FindWindow is IntPtr since IntPtr is the width of the proc it's on.
Private Declare Auto FindWindow Lib "user32" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String ) _
As IntPtr
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Long is 64 bits on a 32 bit proc and 128 bits wide on a 64 bit proc.
Is it ? In C++, it's 32 bit for 32 bit processors, the same as int.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In VB.NET, Long is 64-bits wide. In VB6, it's 32-bits, same as an Int32 in the CLR. Visual Basic.NET: Integral Types[^]
Come to think of it...I really can't confirm that a VB.NET Long is 128-bits wide on a 64-bit proc. I don't have one to test it. It could very well be locked at 8 bytes wide.
I can, however, confirm that IntPtr is the same width as the proc data width.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|