You can, but it may cost you
What you’re doing is combining two separate magic items (unless you find a weapon property that explicitly grants fireball 1/day), since the guidelines are for a separate magic item. Combining a second magic item into a magic item costs what the second item costs, plus 50% the cost of the lower-value item. In your case, your 26,000 gp +3 vanishing longsword and your 12,000 gp item that fireballs combine for not 38,000 gp, but rather 44,000 gp: an extra 6,000 gp, or half the cost of the item that fireballs.
Now, the crafting guidelines are just that: guidelines. Your DM has to review what the guidelines say, and make a decision: yes, no, or yes-but-for-a-different-price. Were it me, I’d probably waive the 50% penalty for combining the items, but that’s a question for your DM.
Anyway, this does not affect the enhancement-equivalent of your weapon, just like vanishing does not. Your weapon is still a +3-equivalent, which means further enhancement bonuses or enhancement-equivalent properties are adding on to 3 for figuring out their value, and you can still go all the way up to +10-equivalent (i.e. have another +7-equivalent to add). However, in addition to the limitation of +10-equivalent, there is also a limit of 200,000 gp for any pre-epic weapon. The vanishing definitely counts towards that limit; the cost of adding in the item that fireballs is less clear; you’ll have to ask your DM.
A wand of fireball in a wand chamber would be massively superior
If you can activate it (at least a single level in a class that eventually gets fireball, or DC 20 Use Magic Device check), a wand of fireball is massively more economical. You could even get an eternal wand of fireball,MIC for fireball 2/day, if the 50 charge thing worries you.
Then Dungeonscape allows you to modify any weapon for 100 gp to add a wand chamber, allowing you to have the wand in your hand, ready to go, any time your weapon is.
Also, fireball is a really bad spell
Fireball is a very poor spell, and very much not worth 12,000 gp to get 1/day. 12,000 gp could improve your weapon enough to deal far more damage than a fireball is likely to do, several times a day.