Have you any experience with programming at all? If so, I'd expect that you'd have some understanding of basic debugging techniques - such as checking that the data you're passing to functions is valid. You might want to attend a SKILL Programming class (or any programming class), and read the SKILL Language User Guide too.
I don't mean to be rude, but the error message fairly clearly tells you that the libname variable must be nil (i.e. not the library name). If you'd put some print statements in your code (or used the SKILL debugger) you could have checked that. The most likely explanation (assuming your code is essentially the same as that you posted earlier) is that cv is nil, because you're running with the current window not being your schematic or layout window - and hence geGetWindowCellView() is returning nil.
That said, I'd have expected that you'd see a warning in your CIW if this was the case (and that might have alerted you to the problem?):
*WARNING* (GE-2067): geGetWindowCellView: There is no graphical edit environment assigned to window(2) because the window is not a graphic editor window.
Make sure that your current window is a valid graphic editor window.
If it is a valid graph editor window, contact customer service to investigate this issue.
Either way, check the variables in your code, and ensure they're being set properly.