|
A range when created through VBA does not have to be in a temporary worksheet, it can be stored in memory. And I do not want to iterate using loops because it is horribly inefficient and time consuming, especially with larger ranges. Array/Matrices operations are much faster and use Excels native built-in functions which execute a lot faster.
|
|
|
|
|
Ok, I understand now what you are looking for...
Maybe this[^] will help?
|
|
|
|
|
I've written a program for my company that produces reports from the data in the instruments we use. The reports are Excel XML files that are converted into PDFs and then all the PDFs are merged into a single file for printing. Creating the XML files and merging the PDFs (thanks to iTextSharp) is no problem. However I was originally using Adobe Acrobat to actually print the PDFs and now my company has decided that they are not going to get Acrobat on everyone's computer so I need a new way of creating the PDF files. I know there are free PDF printers that I can download to everyone's computer and have Excel print directly to them. However I would prefer to completely take Excel out of the loop. I was wondering if anyone was aware of any libraries or examples of code whereby I can create a PDF from the Excel files without having to use Excel to print? Any suggestions would be greatly appreciated.
|
|
|
|
|
If you want static reports in PDF format, I believe Crystal Reports can do this.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Pretty much I have to still with Excel only because we sometime have to submit the Excel files to state agencies we work with, but thanks for the advice.
|
|
|
|
|
Hello! I've an application that uses vbSendMail.dll for emails. When in debug mode the application works smoothly. However once I've compiled/packaged the app using VS package and deployment wizard it does not send emails. Weird thing is it does not generate any error. vbSendMail.dll and mswinsck.ocx both have been included in the package and registered successfully. By the way I'm using vb6 for this app. This is the part of the email code
Set vbemail = New vbSendMail.clsSendMail
vbemail.SMTPHost = "****.*****.***"
vbemail.FromDisplayName = ""
sendemail
...................
vbemail.From = senderemail
vbemail.CcRecipient = "*********"
For i = 1 To Adodc3.Recordset.RecordCount
vbemail.Recipient = vbemail.Recipient + Adodc3.Recordset!email + ";"
Adodc3.Recordset.MoveNext
Next i
If Not txtemail.Text = "" Then
vbemail.CcRecipient = vbemail.CcRecipient + ";" + txtemail.Text
End If
vbemail.Attachment = Adodc1.Recordset!screenshot
vbemail.Subject = "[INCIDENT] WSA " & Adodc1.Recordset!incident & " " & Adodc1.Recordset!datereported
vbemail.Message = "Hi Sir/Ma'am" & Chr(13) & Chr(13) & "IR NO. : " & Adodc1.Recordset!irno & Chr(13) & "STATUS: " & Adodc1.Recordset!Status & Chr(13) & "PROBLEM CLASSIFICATION: " & Adodc1.Recordset!problemclassification & Chr(13) & "PROBLEM: " & Adodc1.Recordset!problem & Chr(13) & "RESOLUTION: " & Adodc1.Recordset!resolution & Chr(13) & Chr(13) & "WEBSITE: " & Adodc1.Recordset!websitename & Chr(13) & "DETAILS:" & Adodc1.Recordset!details & Chr(13) & "URL / LINK: " & Adodc1.Recordset!url & Chr(13) & "BROWSER USED: " & Adodc1.Recordset!browsertype & Chr(13) & Chr(13) & fulln & Chr(13) & departmnt
vbemail.Send
Set vbemail = Nothing
MsgBox "Email Sent", vbExclamation
Thanks in advance for any assistance on this dilemma
Aim small, miss small
|
|
|
|
|
I don't know if that is .net or vb6, but I would tell you to check out This[^] article on how you can send emails with the .net framework.
|
|
|
|
|
I don't have the solution to your problem but I do have code that will work for you try:
Dim myMail As New MailMessage()
Dim eFrom As New MailAddress("*****@****.***")
myMail.From = eFrom
myMail.To.Add("*****@*****.***")
myMail.Subject = "Your subject"
myMail.Priority = MailPriority.High
myMail.Body = "Your message"
Dim myAttachment As New Attachment("your attachment")
myMail.Attachments.Add(myAttachment)
Dim smtpClient As New SmtpClient("**.**.**.**") 'Whatever your mail server address is
smtpClient.Send(myMail)
Replacing any * with the proper character and leaving out anything you don't need. Also remember to import Imports System.Net.Mail
|
|
|
|
|
You can't "imports" the .NET Framework libraries in VB6.. You can however, make a small executable that sends the file in VB.NET (download the VB.NET Express IDE, it's for free) and launch this process from VB6 whenever you need to send a mail
I are troll
|
|
|
|
|
|
I would have thought you may have more luck in the mobile development forum. Look on the left 2 above the VB link!
I suspect you will be abused there as well for asking for the code.
We are here to help, not do the work for you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have one windows application in that i created multiple exes.Now I am trying to build my application and combine multiple exes to one exe.But i am unable to that can you tell me the procedure to combine multiple exes to one exe and build that exe. If I build each exe seperately the application is also running seperately for each exe.
Thanks in Advance
pavani
|
|
|
|
|
You have a fundamental design problem, an exe by definition is atomic, you need to pick one of your program files (EXE) as the applicaion launcher and turn all the others into DLLs that are referenced by the application exe.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your quick response.But in that code exe seperated by different module type.eg.one exe per one module.I will try it once.
|
|
|
|
|
I have an windows application there are different modules.for each module i created seperate project.so there are different exes for each module.now i am trying to combine those modules and trying to build whole application with one exe.they are working when i build individual exe.when i install the exe i am getting 4 exes for 4 modules.
|
|
|
|
|
You have, as has been stated, a serious fundamental design flaw in your application.
There is NO WAY to combine seperate .EXE's to into a single .EXE.
|
|
|
|
|
If you truly have 4 sep. exes, then break them out into their own respective executable. Then build a Menu type app that can launch each of the 4.
Otherwise, break the exes into sep objects as recommended by the previous members.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I am using XML as data storage. In below code data is added but problem is Previous data losing.
The Previous data deleted and new data is added give me any solution.
This is code I m using.
Dim xml_write As New XmlTextWriter(Application.StartupPath & "\sam.xml", System.Text.Encoding.UTF8)
With xml_write
.Formatting = Formatting.Indented
.Indentation = 8
.WriteStartDocument(False)
.WriteStartElement("CP")
.WriteStartElement("rec")
.WriteAttributeString("no", "Male")
.WriteElementString("f1", "5001")
.WriteElementString("f2", "5002")
.WriteElementString("f3", "BOB")
.WriteElementString("f4", "BOB")
.WriteElementString("f5", "BOB")
.WriteElementString("f6", "BOB")
.WriteElementString("f7", "BOB")
.WriteElementString("f8", "BOB")
.WriteEndElement()
.WriteEndElement()
.WriteEndDocument()
.Flush()
.Close()
End With
Thanks in advance.
|
|
|
|
|
Yep, that's what New means you are asking for a new writer, adding data to the NEW writer and then writing it out which overwrites any existing file.
Suggestion
Use a datatable
1 create the table adding colums as required
2 insert data into the datatable
3 using the datatable's dataset you can write the table to an xml file (you may be able to use the table direct to xml)
2nd time in
1 look for the file
2 read the file into a dataset
repeat 2 & 3 from stage 1
This article uses the above methodology C# only[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Load the XML file into XMLDocument instance. After adding the new values, call XMLDocument.Save . This will preserve the existing data.
|
|
|
|
|
|
Hello every one,
I need some help with text format in rich text box.
I am using a rich text box in which a user can past the text from text editors like Word. There the original format of the text (fonts, size, color)is shown.
But when i get the text and sen it in a db text field and get back i loose all the formatting
How do i retain all the formatting
Regards
Nishkarsh
|
|
|
|
|
I was able to do it by using .rtf property
Now i am facing another issue...
When i get the .rtf text from the rich text box, it is of really big size and the increase in size depends on formatting and things like use of table and other objects.
Not i am not able to find how big the field should be in the db to accommodate text of size 500 char...
I wrote 50 formatted char and it gave 483 char as output. I added a table (no data inside) and it increased to 1093
any idea
Regards
Nishkarsh
|
|
|
|
|
If you don't know how big the text will be, use the MAX version of datatypes. As per documentation, VARCHAR(MAX) can hold 2^31-1 bytes.
|
|
|
|
|
Is the .rtf property the most efficient way to serialize/deserialize the contents of a RichTextBox? Deserializing seems to take time n^3.
|
|
|
|