Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Excel


  • Please log in to reply
2 replies to this topic

#1 myrti

myrti

    Sillyberry


  • Malware Study Hall Admin
  • 33,784 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:At home
  • Local time:12:19 AM

Posted 10 August 2010 - 10:06 AM

Hi,

it seems MS has done it again. After researching for the better half of the day why my macros won't run on my boss' PC, I have finally figured out, that the file extension for add-ins has been changed in Excel 2007 and that macros written (and working) in Excel 2003 won't just run in Excel 2007.

To illustrate this is the macro for Excel 2003:
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("$AE$6:$AE$14"), _
	ActiveSheet.Range("$af$6:$ak$14"), False, False, , ActiveSheet.Range("$ad$20") _
	, False, False, False, False, , False
For it to run in Excel 2007 it needs to be modified this way:

Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$AE$6:$AE$14"), _
ActiveSheet.Range("$af$6:$ak$14"), False, False, , ActiveSheet.Range("$ad$20") _
, False, False, False, False, , False


Since I need both versions of Excel to be able to run my macros I am wondering if there is an easy way of ensuring this? I would like to avoid writing if-statements checking the excel version for every time I call the add-in, if that is at all possible.

regards myrti

is that a bird?  a plane? nooo it's the flying blueberry!

If I have been helping you and haven't replied in 2 days, feel free to shoot me a PM! Please don't send help request via PM, unless I am already helping you. Use the forums!

animinionsmalltext.gif

Follow BleepingComputer on: Facebook | Twitter | Google+


BC AdBot (Login to Remove)

 


#2 thekingpin3000

thekingpin3000

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:05:19 PM

Posted 16 August 2010 - 06:10 PM

Hi Myrti

I was working on a .xls with a macro embedded in excel 2007 and it worked fine (after adjusting macro security settings).
My solution would be to open an .xls with the macro embedded in compatability mode in excel 2007.

Cheers
TKP

#3 myrti

myrti

    Sillyberry

  • Topic Starter

  • Malware Study Hall Admin
  • 33,784 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:At home
  • Local time:12:19 AM

Posted 17 August 2010 - 04:10 AM

Hi,

thanks for the reply.
The issue only appears when you are using plugins, such as solver or the data analysis tool. If you use a macro without those, it will run just fine.

I'm using an if-statement now:
If Application.Version <= 11 Then
Application.Run "ATPVBAEN.XLA!Regress", Sheets("regression").Range("$v$6:$v$14"), _
   Sheets("regression").Range("$w$6:$ab$14"), False, False, , Sheets("regression").Range("$u$20") _
	, False, False, False, False, , False
	ElseIf Application.Version > 11 Then
	Application.Run "ATPVBAEN.XLAM!Regress", Sheets("regression").Range("$v$6:$v$14"), _
   Sheets("regression").Range("$w$6:$ab$14"), False, False, , Sheets("regression").Range("$u$20") _
	, False, False, False, False, , False
End If

I'm just a little baffled that Excel does not provide compatibility for using their own add-ons when going from Excel 2003 to Excel 2007. The only reason we have to use Excelsheets at work is that allegedly it will run on all Pcs. We see how true that is. :thumbsup:

is that a bird?  a plane? nooo it's the flying blueberry!

If I have been helping you and haven't replied in 2 days, feel free to shoot me a PM! Please don't send help request via PM, unless I am already helping you. Use the forums!

animinionsmalltext.gif

Follow BleepingComputer on: Facebook | Twitter | Google+





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users