LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel Add in questions...

Greetings everyone.

I posted this on another section and got refered to here. Not sure if this
is the place to post this, but here goes......



One of our old employees created an excel add in for adding the times on our
excel timesheets. This was for excel 2003. We have since upgraded to Office
2007 and now the add in hangs excel when opening any excel document. I have
tested it and if you deselect the checkbox for the add in, excel will open
fast with no problems. Check the box for the add in and excel will hang every
time.



Here is the code from the file the way it was written, and the actual file
has a .xla file extension:



'Adds the times in the Description of Services column in timesheets
Sub AddTimes()

Dim sCellText As String
Dim sTimeTotal As String
Dim iStartPosition As Integer
Dim iEndPosition As Integer
Dim dTimeTotal As Double

sCellText = ActiveCell

'Steps through the string looking for time entry delimiters
For iStartPosition = 1 To (Len(sCellText) - 1) Step 1

'Finds a time entry beginning delimiter
If Mid(sCellText, iStartPosition, 1) = "(" Then

'Steps through from the current time entry beginning delimiter
For iEndPosition = (iStartPosition + 1) To (iStartPosition + 7)
Step 1

'Finds the corresponding time entry ending delimiter
If Mid(sCellText, iEndPosition, 1) = ")" Then

'Makes sure there is a valid number inside the delimiters
If IsNumeric(Mid(sCellText, (iStartPosition + 1),
((iEndPosition - iStartPosition) - 1))) Then

'Adds this time entry to the total
dTimeTotal = dTimeTotal + CDbl(Mid(sCellText,
(iStartPosition + 1), ((iEndPosition - iStartPosition) - 1)))

End If

'Moves on to the next time entry beginning delimiter...
this one was handled already
Exit For

End If

Next iEndPosition

End If

Next iStartPosition

'Creates the message box with a decent format
If dTimeTotal 0 Then

sTimeTotal = CStr(dTimeTotal)

'Always shows 1 decimal place, even for #.0 time entries
If Len(sTimeTotal) < 2 Then
MsgBox sTimeTotal & ".0", , "Total Time:"
Else
MsgBox sTimeTotal, , "Total Time:"
End If
Else
MsgBox "There are no valid time entries to add in the selected
cell.", , "Select a Description of Services Cell..."
End If

End Sub



Basically, we would enter time in the excel document like this....."worked
on e-mail (.7); worked on monitor (.2).



To add the time, we would press the control key and the t key at the same
time, and it would add everything between the (). Worked perfect till we
changed to office 2007. I am thinking that maybe the file extension could be
the problem, as it seems that all the 2007 office product file extensions
seem to have changed.


Any help would be greatly appreciated.



Craig

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
have several excel questions sheila joiner Excel Worksheet Functions 1 August 17th 06 07:03 AM
2 excel questions Zee Excel Discussion (Misc queries) 1 August 9th 06 12:02 PM
several excel questions gregp22 Excel Discussion (Misc queries) 0 March 19th 06 02:03 PM
excel 2003 questions Wiley C Excel Worksheet Functions 7 May 22nd 05 12:20 PM
excel 2003 questions Wiley C Excel Discussion (Misc queries) 0 May 19th 05 11:19 PM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"