Stuff

Stuff

Tuesday, June 06, 2006

Excel: Code to add picture to Excel Comment: "Ok... so I am not sure of all the medicinal uses of this technology but it is cool. Imagine that you have a list of parts for a product and you want to assign them to cells... then your users could see them as they hover over the cells... I dunno there must be something :s

Anyway, here is the code to do this in VBA (it assumes that the picture name comes from the cell text):

Sub AddPictureToComment()
Dim rng As Range
Dim shp As Comment

Set rng = ActiveCell

If Not rng.Comment Is Nothing Then
rng.Comment.Delete
End If

If rng.Text <> '' Then
Set shp = rng.AddComment('')
shp.Shape.Fill.UserPicture rng.Text
End If

End Sub"

Monday, June 05, 2006

Xanadu - Wikipedia, the free encyclopedia: "Xanadu, Zanadu, or Shangdu (Chinese: 上都; Pinyin: Shàngdū) was the summer capital of Kublai Khan's Mongol Empire, which covered much of Asia. Archeological findings assert that the city was situated in the present-day Inner Mongolia of China. The capital consisted of the square-shaped 'Outer City', 'Inner City', and the palace, where Kublai Khan stayed in summer. The palace is believed to have been half the size of Forbidden City in Beijing (China).

The Mongolian Khans made very few changes to their country, imbibing much of the Confucianist and Taoist philosophies, and remodelling their government on the native dynasties they had defeated. However, they opened up the empire to westerners, allowing travellers like Venetian explorer Marco Polo in 1275 to report the wonders of the Eastern capital to their fellow Europeans.

The reported splendour of Xanadu later inspired Samuel Taylor Coleridge to write his great poem Kubla Khan and caused Xanadu to become a metaphor for opulence. Xanadu is remembered today largely thanks to this poem, which contains the following often-quoted lines:

In Xanadu did Kubla Khan
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea."