p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Excel VBA > Excel VBA
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 24th, 2009, 09:47 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question #NAME? error running Excel 2003 VBA in Excel 2007

Hi,

I made a spreadsheet in XL03 but the VBA functions will not calculate in XL07!

I have saved it as macro enabled, the module exists, the functions appear in the fx dropdown list as I type!

I have set the "Trust Center" options in various ways but can not get rid of the error.


One of my functions:-
Code:
Function timval(tim_str As String) As Single

Dim hrh As Single
Dim minh As Single

hrh = 1 / 24
minh = hrh / 60

Dim hr_st As String
Dim min_st As String
Dim hr As Single
Dim min As Single

' extract hours and minutes from string
hr_st = Mid(tim_str, 1, 2)
min_st = Mid(tim_str, 4, 2)

' convert to numeric
If IsNumeric(hr_st) Then
    hr = hr_st
Else
    hr = 0
End If
    
If IsNumeric(min_st) Then
    min = min_st
Else
    min = 0
End If

' calculate time value in excel format
timval = (hr * hrh) + (min * minh)

End Function
Hope someone can help.

Thanks
Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Conversion Excel 2003 VBA codes to Excel 2007 sunny76 BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 0 August 13th, 2009 06:38 AM
SAving into Excel 2003 or 2007 ppenn Excel VBA 2 August 12th, 2009 10:35 AM
excel 2007 vba UDF DavidReese BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 February 24th, 2009 01:10 AM
Error 50290: VBA in Excel 2003 doing strange thing Andraw Pro VB 6 0 October 29th, 2008 09:44 AM
VBA Print preview in Excel 2007 solnajeff Excel VBA 1 June 23rd, 2008 02:21 PM



All times are GMT -4. The time now is 02:41 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc