This is the Message Centre for Pastey

Excel COM (dull)

Post 1

Pastey

What is it with me and not working? Don't get me wrong and think that I'm lazy, I'm certainly not lazy. I was in work this morning a little after 8am because I want to get this bit of coding finished before the Christmas break. So here I sat coding away, finding a method of granting access privalages to asp.net without making it an administrator. Found a way, you open up the web.config file and add to the authentication tag. That way, when you run the script it pretends to be the computer user instead of the asp user account. It grabs the IIS token and sends that off. Bit technical first thing in the morning, but hey, it worked. So, the script manages to open up an excel file and fiddle about with it to it's hearts content. Then, it saves the file, closes the COM object and says "Ain't I clever?" Which it's not. Because it can't save the file. The error message returns saying that the file is read only, which I know is a load of dingoes kidneys. So, I say, "Alright then, don't Save the file, SaveAs it instead", and it says "Can't create the file." "Ah", says I. "That'll explain it then." The bleeding thing doesn't have write privalages on the server, but hang on, I've just given it them. Now I'm getting confused. You see, last night one of our network guys set the server to give asp.net admin privallages, although he didn't bounce the server so they're not in effect yet. I was then able to give it impersonate privalages and it opens COM objects, but I'm not sure if the server needs to be bounced for full impersonate privallages to take hold. So, when the server is bounced, if it works, we're not going to know what fixed the problem, the impersonation or the admin rights. Ho hum, I'm sure we'll figure it out by the time it goes onto the live server. I hope.

What else then? Well, surprisingly I've got a bit of a headache. Although to be fair it's more of a dull throb than anything else.

We're also about to run out of coffee in the office. Tea went sometime last week, there's loads of sugar but not much milk. Hopefully when the coffee runs out someone with some cash will go out and buy some more. Hopefully. Well, let's face it, they either do that or they go without. I really should have brought some tea leaves in with me, then I could have had a nice hot cup of tea.

Driving home last night was nice, if a tad dangerous. My mind kept wandering off and actually enjoying the drive through the country. Okay, my concentration wasn't 100% on the road, but there were virtually no cars about, and you can see headlights for miles on the road I take home. I might even go for a longer drive tonight if I feel the same way on the way home.

Kinda scary though as I've had two dreams already this week where people I know have died in car accidents. I really hope that these aren't premonition dreams. I get them occasionally. Not the see it exactly as it's going to happen type, but more the something trying to tell you someone type dreams.

At least I've got asp.net writing to and saving excell sheets, I just thought, hey, get the Network guys to grant full privalages to the folder the files are in, and then let them sort it out later.

So now all I have to do is to put all the subs and such that I've been developing to COM with excell into the company's purchase system. No worries. After all, I designed and wrote the purchase system, so I know that it will fit in. That may sound like I'm being big headed, but I thought at the time that it'd be really neat if the purchase system was able to interact with the customer database, the sales system and the accounts system. The accounts system is the one that works from excell spreadsheets. It may seem like a strange way of doing it, but apparantly it's easier to then import the data into Quickbooks. I'm staying out of that arguement as it's already caused a riff between the two bosses.

So this week I'll mostly be adjusting COMSubs. Oo-er missus.
Right, onto the COMSubs... wish there was a cup of tea around here. All I've been able to find is a Broccoli and smudge cup-a-soup and that strange old tea bag. Might have the cup-a-soup to put me on. I wonder what the caffiene content of a cup-a-soup is? Does it actually have any?

smiley - rose


Key: Complain about this post

Excel COM (dull)

More Conversations for Pastey

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more