|
Hey,
Thx Dave it was a really helpfull article.
Can you check if i forget something?(maybe in my catch blok or something?)
Dim oApp As New Excel.Application()
Dim oBook As Excel.Workbook = oApp.Workbooks.Add
Dim oSheet As Excel.Worksheet = oApp.ActiveSheet
Dim chartRange As Excel.Range
'hoofding
chartRange = oSheet.Range("A1", "I1")
chartRange.Merge()
chartRange.FormulaR1C1 = "WorkBook"
chartRange.Font.Bold = True
chartRange.Font.Size = 20
chartRange.HorizontalAlignment = 3
'chartRange.VerticalAlignment = 3
'Save the Workbook
oBook.SaveAs(sSampleFolder & "V.F." & idvoorexcel & "-" & Label6.Text & ".xlsx")
oSheet = Nothing
oBook.Close(False)
oBook = Nothing
oApp.Quit()
oApp = Nothing
System.Threading.Thread.Sleep(3000)
End If
Catch ex As Exception
MsgBox("location : catch blok")
oSheet = Nothing
oBook = Nothing
End Try
Greetings
|
|
|
|
|
Yeah, I see no mention of Marshal.ReleaseComObject() .
You might want to go back and re-read the article.
|
|
|
|
|
Hey i'm back from a student holiday
Thx for all the answers i will vote 4 them...
I posted the wrong code snippet
here is the code that i wanted to post :
Imports Microsoft.Office.Interop
Try
Dim oApp As New Excel.Application()
Dim oBook As Excel.Workbook = oApp.Workbooks.Add
Dim oSheet As Excel.Worksheet = oApp.ActiveSheet
chartRange = oSheet.range("A20", "G20")
oSheet.Range("A20").Value = "blabla"
chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, _
Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex. _
xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic)
'Save the Workbook and quit Excel.
oBook.SaveAs(sSampleFolder & "V.F." & idvoorexcel & "-" & Label6.Text & "-" & DateTime.Now.ToString("ddMMyyHHmmss") & ".xlsx")
oSheet = Nothing
NAR(oSheet)
oBook.Close(False)
NAR(oBook)
oBook = Nothing
oApp.Quit()
NAR(oApp)
oApp = Nothing
System.Threading.Thread.Sleep(1500)
End If
Catch ex As Exception
NAR(oSheet)
oBook.Close(False)
NAR(oBook)
oSheet = Nothing
oBook.Close(False)
oBook = Nothing
System.Threading.Thread.Sleep(1500)
GC.Collect()
End Try
Private Sub NAR(ByVal o As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub
By the way nice link with the NAR
Still don't know if i oversaw something?
Thx D
|
|
|
|
|
Hi,
I want to make one application that reads the pdf file and write that data in to excel sheet and after i have to make a chart in excel sheet.
Here, my problem is ,i do not know how to read the pdf file in VB .Please kindly help me by giving some solution or is there any tutorial or article related to this concern.
Anu
|
|
|
|
|
Anu_Bala wrote: any tutorial or article related to this concern.
Yes plenty[^].
|
|
|
|
|
I don't know why you were down-voted, it was a perfectly legit answer.
|
|
|
|
|
Dave Kreskowiak wrote: I don't know why you were down-voted
The usual reason I expect! However, thanks for your high value vote.
|
|
|
|
|
Actually what your are all talking about.I did not vote for anyhting.May be by mistake it get voted.where i can put vote for your answer??
Anu
|
|
|
|
|
Go to the answer message and click on one of the numbers on the right hand side; 1 for bad, 5 for good.
|
|
|
|
|
Hi,
I am trying to create a billing application. In this I need multilanguage support. I have to use Telugu, by which user will be entering the data to fill the form. How do I create an application with Telugu supporting.
Kindly let me know, are there any such samples, so that I can refer and build the application.
Thanks,
Ranga
RN
|
|
|
|
|
Your bigger problem is why are you using VB6 in this day and age for new developement??
VB6 is dead and there won't be any support for it's runtime in Windows 8. Your app is already obsolete and you haven't even finished writing it! Pickup VB.NET and start there before you really screw yourself over having to rewrite this app soon after you release it.
|
|
|
|
|
As mentioned, VB6 isn't for sale anymore. Unlike languages as Pascal or C, VB6 is owned by Microsoft and they have decided to decapitate it. That's happened quite a few years ago, which explains why you're having a hard time finding examples.
Furthermore, VB6 comes from an era where we didn't use UTF8 everywhere. Your best bet would indeed be to move to VB.NET; you can still use most of the old syntax, and multi-language applications are very well supported.
VB.NET is available for free, just as the IDE is. VB6 isn't available. Not for free, not for money.
Bastard Programmer from Hell
|
|
|
|
|
Use VB.Net, VB6 went the way of the dinosaurs.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
VB6 been dead for a long time. You better off using something like VB.Net instead.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello
I have a small problem with combobox.
So the form has a panel with optionbuttons and dependin on the click of user,the combobox will display various items.
the problem is that how often i click the optionbutton,in the combobox the items are being replaced.alfer a few clicks the combobox is full with duclicated names.
how can i avoid this?
i use this code for optionbutton
Private Sub Option1_Click()
Label7.Caption = "Përdoruesi"
Call DB
ar.Open "Select *From tblPerdoruesit", strConek, adOpenStatic, adLockOptimistic
If ar.RecordCount = 0 Then
Exit Sub
Else
ar.MoveFirst
Do While Not ar.EOF
cboSubjekti.AddItem ar!EmriUser
ar.MoveNext
Loop
ar.Close
End If
End Sub
|
|
|
|
|
Where do you 'clear the combobox
combobox.items.clear???
Jan
|
|
|
|
|
Thank you for the help.
i used this code : cboSubjekti.Clear
|
|
|
|
|
hi,
i can change the web.config at run-time because its just like a text file.
is my approach is good thing to change at run-time?
the goal is to change database when the user clicks
a radiobutton, let say, rdoDB1 and rdoDB2.
the problem is grid are not reflecting to the new database but when i close the page then start again,
grid shows data with new database which set in web.config.
thanks in advance for your time.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
sorry, i figure out already, i just create two connection string.
thanks
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
I use VS2008 where I have a program where I have about 20 tabpages with datagridviews and textboxes.
But when it comes to printing my form my programming skills is not good enough.
Here is how one of my forms looks like:
[IMG]http://i85.photobucket.com/albums/k72/johmolan/VB_NET/form1.png[/IMG]
I want to print out the data I have in my datagridviews with the columnheads, together with the data in my textboxes
and the labels explaining what the values are.
I have come to the conclution that there is no easy way to do this, but I still have my hopes up that there is a way to do this.
have anyone of you done something like this before and can give me a little hint on how to go on?
I had some thought on maybe to use somethong like the tabcontrol or something but as I said my skills aint that good yet but maybe some of you can lead me in the right direction.
|
|
|
|
|
I am afraid, you will have to get down and dirty with the PrintDocument Class[^] [MSDN] on this one. Your best bet is to design your output on paper first, and then use the PrintDocument class to recreate this with the printer.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Hello everyone,
Please look the code below. I use this on a formclosing event.
when i do a trace on the If Me.FireArmsTB_DataSet.HasChanges, it goes directly to the END IF to whatever dlgResult is.
what seems to be wrong here.
Using vb.net
Dim dlgResult As Integer
If Me.FireArmsTB_DataSet.HasChanges Then
dlgResult = MessageBox.Show(Me.Usernamelabel.Text & " " & " " & "êtes vous sûr de sortir sans avoir sauveguarder?", "Fermez!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes
If dlgResult = 6 Then
Me.FireArmsTBTableAdapter.Update(Me.FireArmsTB_DataSet.FireArmsTB)
ElseIf dlgResult = 7 Then
e.Cancel = False
Else
e.Cancel = True
End If
End If
Thanks in advance
|
|
|
|
|
waner michaud wrote: dlgResult = MessageBox.Show(Me.Usernamelabel.Text & " " & " " & "êtes vous sûr de sortir sans avoir sauveguarder?", "Fermez!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes
That results in dlgResult being a Boolean, being True or False . That don't make sense with the If statement that follows.
Is your Option Explicit OFF?
Bastard Programmer from Hell
|
|
|
|
|
I think you have to insert e.Cancel = True
If dlgResult = 6 Then
Me.FireArmsTBTableAdapter.Update(Me.FireArmsTB_DataSet.FireArmsTB)
e.Cancel = True
ElseIf dlgResult = 7 Then
e.Cancel = False
Else
e.Cancel = True
End If
Greetings from Germany
Horst
|
|
|
|
|
i have a form and bindingsource to a entity.i need to sort records using a field.But the sort property has no effect.
The code is :
------------------------------------------------------------
lstBindingSource.DataSource=context.lst
lstbindingsource.Sort="name ASC"
--------------------------------------------------------------
But , the records are not sorted by "name" column.
i try also :
----------------------------------------------------------------------
lstBindingSource.DataSource=from t1 in context.lst order by t1.name ascending
select t1
-----------------------------------------------------------------------
.... and this resolve my problem , but when i add a new record or modify the field "name" of an existing record , after that the records are not in order by "name".
What can i do to resolve this problem ?
Thank you.
|
|
|
|