[python-win32] Excel calls failing

2007-05-03 Thread Carlos Izquierdo
Hi, I'm fairly new to Python COM development and I'm having trouble automating Microsoft Excel. I have the following piece of code: d = win32com.client.Dispatch('Excel.Application') d.Visible = 1 dw = d.Workbooks.Open('c:\\datos.xls') dw.Sheets(1

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Tim Roberts
Tim Golden wrote: > > (I spend most of my WMI time doing detective work like that!) > > I think what I meant was that the OP wanted to step through > some kind installation process when the device was initiated. > At least, I think that's what he wanted to do. And I'm not > sure how much closer the

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Tim Golden
Tim Roberts wrote: > Tim Golden wrote: >> It's actually made a bit easier by using >> the Win32_DeviceChange event under WMI >> (you will not be surprised to hear me say!) >> >> But once you've got the fact that the device has >> changed, I'm not sure where you go from there... > > I admit that WM

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Tim Roberts
Tim Golden wrote: > > It's actually made a bit easier by using > the Win32_DeviceChange event under WMI > (you will not be surprised to hear me say!) > > But once you've got the fact that the device has > changed, I'm not sure where you go from there... I admit that WMI is not my strong suit, but

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Tim Golden
Tim Roberts wrote: > Simon Dahlbacka wrote: >> Random thought.. there *has* to be a better way of finding out when a >> usb device is plugged in... >> >> (not that I know how, but I haven't needed to find out either..) > > Oh, there is. You can watch for the WM_DEVICECHANGE message, which > fires

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Jerry Hill
On 5/3/07, Tim Roberts <[EMAIL PROTECTED]> wrote: > Oh, there is. You can watch for the WM_DEVICECHANGE message, which > fires every time there is a plug-and-play event. Once you get that > message, you can go enumerate the devices in your device class using the > SetupDi APIs to see if you are p

Re: [python-win32] Help needed : FindWindowEx

2007-05-03 Thread Tim Roberts
Simon Dahlbacka wrote: > Random thought.. there *has* to be a better way of finding out when a > usb device is plugged in... > > (not that I know how, but I haven't needed to find out either..) Oh, there is. You can watch for the WM_DEVICECHANGE message, which fires every time there is a plug-and

Re: [python-win32] Python-win32 Digest, Vol 50, Issue 5

2007-05-03 Thread Tony Cappellini
When your program starts, take a snapshot of all the storage devices. You can do this with a timer, every few seconds or so. If the new snapshot changes from the original, you can call an API to see if the new device is removable or not. This won't tell you if it's a USB drive specifically, but fo