Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2004, 06:34 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel Increment Problem

Hi there!

I have got a really enoying problem with increment a number out of a text file into excel and use this number to send it as a number in the subject of an email.

Here is my code:

Private Sub LOV_Click()
If MsgBox("Send it?", vbOKCancel) = vbOK Then

Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs FileName:="C:\LOV.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWorkbook.SendMail Recipients:="mail@mail.com", _
Subject:="Something" & "-" & Range("C1").Value & "-" & "IncrementNr" & "-" & "LOV"
ActiveWorkbook.Close True
Dim KillFile As String
KillFile = "c:\LOV.xls"
If Len(Dir$(KillFile)) > 0 Then
SetAttr KillFile, vbNormal
Kill KillFile
End If
End If

End Sub

The thing is, to differntiate between the excel files, the users are going to send to me, i would like to make use of a txt.file from which excel is getting a specified number e.g. user1 is sending this file, excel looks in the txt file before sending, excel sees that the number is for example 5, excel writes number 6 into the txt file, and uses it in the subject, so that I know which of the excel files are the newest. It doesn't matter if two Users are working at the same time with the excel file. User2 would increment number 7 and send the number 7 in the subject of the email. Puuhh....hard work, isn't it? It is no problem to implement a number from Excel into the subject for me. but what can I do to tell excel to read the txt file than increment the number in the text file, take that number and copy it to specified range in the excel sheet to "vba" it into the subject?

How can I do this? Any reply is greatly appreciated!!

Jim


Reply With Quote
  #2 (permalink)  
Old February 20th, 2004, 11:52 AM
Authorized User
 
Join Date: Feb 2004
Location: Sacramento, CA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Still having this problem?

Dave
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Increment Operators alexdelamuerte BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 2 December 3rd, 2008 11:51 AM
Auto Increment Field Problem in SQL Server 2000 yes_no ASP.NET 1.0 and 1.1 Professional 4 August 11th, 2008 07:10 AM
Problem in opening excel file in MS Excel 2000 kallol Visual C++ 0 November 16th, 2007 05:48 AM
Increment a tag stefan.yu XSLT 10 April 16th, 2007 05:45 AM
Auto increment prad_a MySQL 3 April 7th, 2007 05:47 AM



All times are GMT -4. The time now is 01:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.