I wear the cheese. It does not wear me.

Cheese Man ,'Chosen'


Buffistechnology 3: "Press Some Buttons, See What Happens."

Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!


tommyrot - Jun 12, 2008 10:15:53 am PDT #6558 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

You haven't accidentally changed your computer to European date formatting, have you?

Also, does the Year function work outside of VBA (i.e. in a cell)?


Jon B. - Jun 12, 2008 10:20:30 am PDT #6559 of 25501
A turkey in every toilet -- only in America!

Yes, it works in a cell.

I still don't know why it's not working in VBA, but i found a workaround using the DatePart function.

Now, to figure out why Application.WorksheetFunction.Sum isn't working either...


Vortex - Jun 12, 2008 10:24:59 am PDT #6560 of 25501
"Cry havoc and let slip the boobs of war!" -- Miracleman

Hey, all. What happens if I take my old iPod (which was permissioned to my old computer, which has gone to the great network in the sky) and hook it up to the new computer/iTunes? Will it wipe the info on the old iPod and upload the new iTunes?)


tommyrot - Jun 12, 2008 10:29:06 am PDT #6561 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

Now, to figure out why Application.WorksheetFunction.Sum isn't working either...

Um... have you tried rebooting?

I'd also go into the VBA window and check Tools/References and make sure none are broken.

When we have weird problems like this in Access, sometimes a decompile/recompile will fix things. Dunno how to do a decompile in Excel (in Access you do it with a command-line switch) but you could try copying the code in question and pasting it into a new Excel spreadsheet VBA module.


Jon B. - Jun 12, 2008 10:49:50 am PDT #6562 of 25501
A turkey in every toilet -- only in America!

Application.WorksheetFunction.Sum was working; I was adding up a range of cells before writing the values of that range to the worksheet. My bad. Still doesn't explain the Year function issue but I should be good.


DebetEsse - Jun 12, 2008 11:34:53 am PDT #6563 of 25501
Woe to the fucking wicked.

Vortex, I believe the answer is yes (I'm looking at this now.) It looks like there are programs to allow you to pull the files from the iPod onto the computer.


Gris - Jun 12, 2008 11:59:49 am PDT #6564 of 25501
Hey. New board.

huh. Jon, that's odd. My guess is that some library you have referenced is overriding the Year function somehow. VBA apparently lets you overwrite functions with impunity. At least, if I write the code below:

Sub test()
MsgBox Year(Now)
End Sub

Function Year(bob() As Date)
Year = 2008
End Function

in Excel 2004 on a Mac, it gives the error "Type Mismatch: Array or User-Defined Type Expected" when I try to run test.


Gris - Jun 12, 2008 12:12:42 pm PDT #6565 of 25501
Hey. New board.

Extra reading has shown me (and testing has confirmed) that IF that's the problem, you can solve it by using VBA.Year instead of Year.

That is, the code below correctly returns "2008" instead of an error:

Sub test()
  MsgBox VBA.Year(Now)
End Sub

Function Year(bob() As Date)
  Year = 1999
End Function


Vortex - Jun 12, 2008 12:16:32 pm PDT #6566 of 25501
"Cry havoc and let slip the boobs of war!" -- Miracleman

It looks like there are programs to allow you to pull the files from the iPod onto the computer

oh, good. I'm not worried about the stuff on the iPod, I'm worried that the stuff on the iPod will overwrite the iTunes.


amych - Jun 12, 2008 12:18:55 pm PDT #6567 of 25501
Now let us crush something soft and watch it fountain blood. That is a girlish thing to want to do, yes?

I'm not worried about the stuff on the iPod, I'm worried that the stuff on the iPod will overwrite the iTunes.

Not a worry. The stuff in iTunes can wipe your 'Pod if you're not careful, but it never goes the other way.