Re: win32 question in Python



On Jul 30, 11:49 pm, Brad Johnson <Brad.John...@xxxxxxxxxxxxxxx>
wrote:
Huang, Shun-Hsien <shuang <at> ercot.com> writes:



but how do I copy a excel file into

database table by using Python?

I'm not sure if this helps, but you can access the Excel Automation model very
easily with:

import win32com.client

x1 = client.Dispatch("Excel.Application")

Now you can use the x1 object to access any of the properties and methods in the
Excel Automation model.

I have only used this to export data as Excel, but it may fulfill your
needs for importing:

http://sourceforge.net/projects/pyexcelerator/

Ali

.



Relevant Pages

  • Re: Merge word applications
    ... you will have to save the two files to disk. ... you need to use the Excel automation model to open each document in ... an instance of Excel. ... You can then take the file and read the bytes into a byte array. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: win32 question in Python
    ... on ActiveState.com wher ethey do talk about excel & other Win32 python ... I'm not sure if this helps, but you can access the Excel Automation model very ...
    (comp.lang.python)
  • Re: Running Excel Addin from VBA in Access....HELP!!
    ... You initially build a macro in Excel to do what you want, ... imbeds it in an Excel file of your choosing, then runs it as a macro. ... code that creates an Excel file, ... Dim objUniqueTeams As Object ...
    (microsoft.public.access.modulesdaovba)
  • Re: Real Workaround for Excel Link Bug in 2007?
    ... you'd need the Excel file in the local directory. ... Or did you mean local HDD vs "the same directory as the PPT itself"? ...
    (microsoft.public.powerpoint)
  • Re: Import same Excel ranges from many workbooks
    ... Import Data from that EXCEL File via TransferSpreadsheet" in your suggested ... Dim strTable As String, strBrowseMsg As String ... accept the named ranges from those Excel workbooks without errors. ...
    (microsoft.public.access.modulesdaovba)