Excel 2003 VBA and OO4O

I have been able to successfully connect to the database and execute a few Select Statements and bring that data back into Excel, but I am having trouble executing a DDL Create Table Statement, here is my code, please help, not sure what is going on. I have the drivers for OO4O installed in XP and "Oracle InProc Server 5.0 Type Library" is checked marked for use.
Ok, I am making this Excel VBA thing that will execute a series of
queries and bring in Analysis Data, the first step that I need to do
is execute a DDL query to create a Table:
Any variables that hold data are in the code, I just simplified it and
removed them, that all is good, I put watch on them to see what values
they got.
Sub Process_AdHoc_Analysis_Report()
Dim OraDynaset As Object
Dim objSession As Object
Dim objDataBase As Object
Dim sql1 As String
Set objSession = CreateObject("OracleInProcServer.XOraSession")
Set objDataBase = objSession.OpenDatabase("database", schema & "/" &
password, 0&)
sql1 = "create table " & tablename & "_1" & " as select * from table
where cmpgn_id='" & campaignid & "';"
objDataBase.ExecuteSQL (sql1) <-- here is the error "Run-time error
'440': Automation error
End Sub

Try without "," in the final sql sentence.

Similar Messages

  • Return String from Oracle stored proc using Excel 2003 VBA

    Hi to everyone,
    I've got a problem that remains unsolved for many days. I am trying to return a value of an oracle stored procedure using Excel VBA. It might seem trivial, however it's not for someone, who has never done it before...
    OS: Win XP SP3
    Excel 2003
    Ora Client: 11g
    By trying different things I have noticed, that I could have troubles with the ODBC-connection. Maybe I am not using the right one. To store data returned from select statements I have an ODBC-Connection (Driver: Oracle in XE), which works perfectly, e.g.:
    Sub Extract_Data()
    Dim cn As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim db_name, UserName, Password As String
    cn.Open db_name, USerName, Password
    sql_statement = "SELECT some_text FROM some_table"
    Set rs = cn.Execute(sql_statement)
    rs.MoveFirst 'jump to the first entry in the data list
    Row = 2
    While Not rs.EOF
    'save the data to a worksheet
    ip.Cells(Row, 2) = rs(0).Value
    Row = Row + 1
    rs.MoveNext
    Wend
    End Sub
    Now I need to execute a stored procedure to return a semi-colon delimited string.
    I have tried the following:
    Public Sub obj_class()
    Dim cn As New ADODB.Connection
    Dim strSQL, cn As String
    Dim adoCMD As ADODB.Command
    Dim adoRS As ADODB.Recordset
    Set wb = Excel.ActiveWorkbook
    Set ih = wb.Sheets("InfoSheet")
    cn.Open db_name, UserName, Password
    Set adoCMD = New ADODB.Command
    With adoCMD
    .ActiveConnection = cn
    .CommandText = "S#mdb$stg_da_extr_util.get_all_classes_of_classif"
    .CommandType = adCmdStoredProc
    .Parameters.Refresh
    '------ and here comes the error saying:
    '------ could not find the object in the collection corresponding to the name or ordinal reference requested by the application
    .Parameters("i_caller").Value = "'STG_DATA_REQUEST'"
    .Parameters("i_obj_classif_id").Value = 120
    Set adoRS = .Execute()
    End With
    End Sub
    I did asked on the forum:
    http://www.access-programmers.co.uk/forums/showthread.php?p=1241667#post1241667
    but unfortunately without success.
    Could it be, that my ODBC-connection is wrong? When debugging the connection string, I find the Provider=MSDASQL5.1.
    I have moderate knowledge in VBA, but absolutely a newbie with Oracle DB. Is there any source of information that can help solving this issue? Looking forward to hearing from you, as I am almost giving up... ;(

    My VBA is super rusty. Does that error come after Parameters.Refresh, or after .Parameters("i_caller").Value = "'STG_DATA_REQUEST'"?
    If it's the second one, you'll need the definition of the stored procedure so you can see what parameters it's expecting. That'd mean you're getting something wrong with the names.

  • I am trying to find an app that will interface with Windows XP home that will alllow me to download Excel 2003 files and run/change on an original Ipod. I have found Quick Office which is useless as cannot reduce font sizes to view a sensible area.

    Is there an app that will allow me to move and edit Excel 2003 spreadsheets to and from Windows XP home that is better than QuickOffice. QuickOffice does, but will allow the usual Apple zooming facility on my Ipod Touch ?
    Peter Campbell

    I have Office Plus on my iPhone.  I don't know if it's compatible with yours.

  • Migration from Excel 2003 - VBA to 2010

    Hi, I support an application that uses VBA macros in XLS 2003 spreadsheets.  As support is being discontinued, I need to migrate to 2010.  I am having trouble finding information on what functions/features are not compatible in the later version. 
    Is there anything published that will give me an idea of how much time I will need to migrate my applications?  

    I'd ask them over here.
    http://answers.microsoft.com/en-us/office/forum/office_2010-customize-customexcel?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1390439934655
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Importing Structure field values in Excel using VBA and SAP RFC

    I am calling a RFC MEASUREM_DOCUM_RFC_SINGLE_001 from Excel VBA. The export parameters of the RFC has a parameter MEASUREMENT_DOCUMENT and structure COMPLETE_DOCUMENT. I am able to get back parameter value in excel from RFC using
    ActiveCell = Funct.imports("MEASUREMENT_DOCUMENT")
    Now I want to get the value of one of the fields say POINT of the structure COMPLETE_DOCUMENT in Excel. The following code doesnt work
    ActiveCell = Funct.imports("COMPLETE_DOCUMENT-POINT")
    It gives an error.
    Even I have tried to using code for tables
    dim tab as object
    set tab = funct.tabels("COMPLETE_DOCUMENT")
    but it did'nt work.
    Can any one help me how to access the field value of a structure?
    regards
    Ravindra

    I am calling a RFC MEASUREM_DOCUM_RFC_SINGLE_001 from Excel VBA. The export parameters of the RFC has a parameter MEASUREMENT_DOCUMENT and structure COMPLETE_DOCUMENT. I am able to get back parameter value in excel from RFC using
    ActiveCell = Funct.imports("MEASUREMENT_DOCUMENT")
    Now I want to get the value of one of the fields say POINT of the structure COMPLETE_DOCUMENT in Excel. The following code doesnt work
    ActiveCell = Funct.imports("COMPLETE_DOCUMENT-POINT")
    It gives an error.
    Even I have tried to using code for tables
    dim tab as object
    set tab = funct.tabels("COMPLETE_DOCUMENT")
    but it did'nt work.
    Can any one help me how to access the field value of a structure?
    regards
    Ravindra

  • Automatic naming of PDFs from Excel 2003 VBA?

    Is it possible to automate the naming of a series of PDFs using file names storde on an Excel workbook using VBA?
    Thanks,
    Tom

    Sure.
    Details of how to program Acrobat are in the Acrobat SDK. Download a copy, read the docs, review the sample code.

  • ? Office 2013 to support Excel 2003 (XLS) spreadsheets containing VBA CommandBars references

    Thanks in advance for reading this and offering any wisdom you have! I am not an expert in any of the following, so apologies if off base.
    The basic problem is: I need to use Excel 2013 to support Excel 2003 (XLS) spreadsheets containing VBA 'CommandBars' references which don't seem to work in Excel 2013. Details below.
    Most of our users are still using older desktop windows PCs and Office 2003!  We are beginning to upgrade to laptops running Windows 8.1 with Office 2013.  Of course, we IT technical people are using the new laptops first. These new laptops are
    64 bit.
    Years ago, someone did a lot of development with spreadsheets here in Excel 2003 file formats that automates many activities and routines. Now we with the new laptops are having to support this development using new machines.
    There is a basic compatibility issue that appears when first opening these Excel 2003 files that have VBA code that I'll detail below; I seem able to get by that problem.
    The current problem appears to be that the existing Excel 2003 VBA code has many references to: "For Each bar In Application.CommandBars". As I've learned, the Application.CommandBars VBA functionality is focused on older MS Office versions' menu
    commands, but "...Starting from Office 2007 the Fluent UI is used instead."  In other words, because MS Office isn't menu-driven beginning with version 2007 (uses 'the ribbon'), it appears that these references to: "For Each bar In Application.CommandBars"
    create a basic incompatibility to opening these spreadsheets in Office 2013.
    For a spreadsheet, after I resolve the issue detailed below and save it, when I reopen it I encounter error "Compile error: can't find project or library." 
    For example, the following code snippet:
    Private Sub Workbook_Open()
    For Each bar In Application.CommandBars
            bar.Enabled = False
        Next
    results in: "Compile error: can't find project or library." 
    (Sorry, can't include images yet, I am not a VERIFIED USER of this forum yet.)
    I went into VBE's menu: Tools>References and check for anything marked MISSING, which I deselected. But I am still receiving this error.
    I don't want to get into changing the code a lot to support both Excel 2003 and 2013 (I am no VBA expert, just a dabbler).
    And Microsoft officially says that Office 2003 is incompatible with Windows 8 although Application.CommandBars seem to be somewhat supported in Office 2013 .
    Are you aware of a quick VBA workaround to get by this?
    •I could comment out the validations, commands for: "For Each bar In Application.CommandBars" but then the spreadsheet code probably won't work for users using Office 2003.
    Alternatives would be:
    •Installing Office 2003 on my Win 8.1 64 bit laptop anyway, in spite of MS's saying incompatible, since this thread discusses at least one person has been able to use Office 2003
    •Keeping one older PC with Office 2003 on it for us to support the old Office 2003 code until everyone upgrades their systems
    Thanks
    Basic compatibility issue that seems solvable:
    Opening these spreadsheets displays this error:
    Compile error:
    The code in this project must be updated for use on 64-bit systems.
    Please review and update Declare statements and then mark them with the PtrSafe attribute.
    This seems resolvable by going into the VBA code and just adding element 'PtrSafe' where functions are declared; in other words, replacing VBA code "Declare Function" with "Declare PtrSafe Function" seems to get by this.

    Hi Allan_L,
    Please try the methods that provided above. And this is the forum to discuss questions and feedback for Microsoft Excel, your issue is related to Excel DEV, if you have further question, I recommend you post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Adobe hangs Excel 2003

    I have several Windows 7 machines that are using Adobe Standard 11 as well as MS Office 2003.  My users are able to run the Excel 2003 VBA code. The code uses a DDEInitiate line and that works great until I open up Adobe 10 and do a print to Adobe to create a PDF. After creating a PDF using Adobe Converter printer the user try's to run Excel again and it hangs.  Even if we try and step through the code as soon as the line of code hits the DDEInitiate it just hangs.  The Excel document will hang for about 1 min and then give us a error saying the program has encoundered an error and stopped wording.  It seems a if the Adobe program is still running in the back ground but I can't find anything.  In order to fix this problem we have the end user re-boot.  Any Ideas?

    [discussion moved to Acrobat forum]

  • Error when opening XLSX file with Excel 2003 SP3, file does open but in read only mode with temporary name

    I am using Excel 2003 SP3 and have the Office 2007 compatibility pack installed.  When I open Office 2007 formatted Excel files (XSLX) directly in Windows Explorer, I receive the following error if I do not have Excel already opened:
    "Windows cannot find '<path to file>'.  Make sure you typed the name correctly, and then try again.  To search for a file, click the Start button, and then click Search."
    Even though I receive the error, the file does open; however, it opens in Read Only mode with a name such as "Xl0000024.xls".  The number seems to increment up each time it happens.
    Now here is the strange part.  If I have Excel already open and try to open the file in Windows Explorer, the file opens fine in Modify mode with no error and with the correct file name.
    I Googled the error I was getting and found KB211494.  It says I should uncheck the box in Options on the General tab that says "Ignore other applications", but this box is already unchecked in my case.  Any other ideas?  This is
    really frustrating as a small percentage of our company has upgraded to Office 2007 with the rest still on Office 2003.

    This may be a file association problem.  To solve that:
    In Windows 7:
    1. Right-click the file,
    2. Select "Open With" 
    select [Your Program Here]
    3. Check always use this program. 
    In Windows XP:
    1. Locate the file as you have described above
    2. Right click the file
    3. Select Open with from the pop-up menu
    4. Click Choose default program…
    5. Select Excel in the Recommended Programs box
    6. Check Always use the selected program to open this kind of file
    7. Click on OK.
    1.  Make Excel not available from Office 2007 listed under Programs and Features in Control Panel.
    2. Take a registry backup using the steps given here
    3. In the registry editor window expand HKEY_CLASSES_ROOT and navigate to .xls right and delete it.
    4. Exit Registry Editor
    5. Undo Step 1 to make Excel available.
    6.  Restart the computer and verify it the issue is fixed.
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire

  • Excel 2003  reports

    Hi,
    I’m working on a system (set of PL/SQL packages) that builds Excel reports.
    Structure of reports is (to some extent) defined by a template (also an Excel spreadsheet).
    If you are interested in this functionality, you can visit:
    http://apex.oracle.com/pls/otn/f?p=30285:16
    Unfortunately currently it works only with Excel 2003 and (I hope) Excel 2007.
    If needed it could be changed to work with older versions.
    Lev

    Hi, Denes
    Yes, I'm using xml. When template is uploaded it is
    analyzed and is broken into parts more or less close to its schema. I found description of the schema on MS website but some information had to be "reverse engineered".
    When the report is built it is built from these parts. There is no expensive XML analysis at this stage (templates are very big, sometimes). Unfortunately not all functionality of Excel is allowed in Excel 2003 (pictures and charts, for instance not allowed). But as far as I understand in 2007 everything will be available.
    Currently only Excel 2003 and 2007 could view the results.
    I saw your very good package that returns Excel spreadsheet as an html page. I think it could be used – create report template as an XML (because it easy to analyze) but present it as html that could be viewed by all versions of Excel starting from Excel-97.
    Thanks,
    Lev
    Message was edited by:
    le

  • I would like to execute an existing BW report from Excel (using VBA).

    I would like to execute an existing BW report from Excel (using VBA) and download the results into Excel.  I understand that there is an Excel Add-In which (I believe) should allow me to do this.  I am an experienced user of Excel / VBA but I have virtually no experience with SAP.  If someone could point me to any source of information or specific instructions I would be extremely appreciative.  I've done multiple searches on the internet but everything I find seems to assume more knowledge of SAP and SAP acronyms than I possess. 

    Paul,
    If your company (or your client's company) has an SAP license (I assume this is the case, since there would be no other reason for you to want to access an SAP system using Excel), there is a person in your company who can request an ID for you.  It is called a SAP Service Marketplace userid, more commonly called an 'S' number.  This person in your company is usually a Basis Administrator.  Go to your SAP Basis team and ask them for access to Service Marketplace.
    The common solution for your Excel analysis problem is to install the Bex Analyzer on your PC.  You will need these same guys (Basis Team) to help you with getting the required SAP access, and to install the associated SAP software onto your PC.
    In the meantime, here is some bedtime reading for you.
    Analysis &amp;amp; Reporting: BEx Analyzer - Business Intelligence - SAP Library
    Best Regards,
    DB49

  • Crystal 2008 and VBA in excel 2003

    We have currently crystal reports in VBA form in excel 2003 using Crystal XI Release 2. when I tried to migrate this report to "Crystal Report 2008 SP2" in VBA, I only found following reference 12.0 library
    Crystal Activex Report Viewer Library 12.0 (Crviewer.dll)
    but I couldn't find any reference library for (Craxdrt.dll) for crystal XI Release 2 it use to be
    "Crystal reports Activex Designer Run Time Library 11.5";
    so If i use 12.0 CRViewer.dll in VBA then I can create report object for it if "Craxdrt.dll"; is missing.
    thanks

    Hello,
    This is a [duplicate posting|crystal report 2008 and VBA in excel 2003;.Please do not cross post the same question to multiple forums. Here's a link to the [Rules of Engagement|http://wiki.sdn.sap.com/wiki/display/HOME/Rules%20of%20Engagement] for reference.
    Sincerely,
    Dan Kelleher

  • Excel 2003 to 2013 VBA migration bug

    Hello!
    I need to convert mission critical workbooks with much VBA code from Excel 2003 to Excel 2013, of which some were originally created using Excel 97.
    When running any VBA macro I get 0x80028018 errors. A similar problem is described in KB320369 - BUG: "Old format or invalid type library"
    error when automating Excel - however in my case it's
    VBA, not .NET or VSTO and
    I have installed the proper language packs.
    I need to describe more detailed:
    Even when I open the legacy workbook in 2013, create a new blank sheet, delete all old sheets and all VBA code, forms etc., put a new command button in, calling any new VBA sub, I get that error.
    When I create a new workbook from scratch, put a new command button in, calling any new VBA sub, there is no error!
    It also makes no difference, if I save it in compatibility mode xls or as new xlsm. See the screenshots.
    I believe there is some legacy metadata in vbaProject.bin, which makes Excel 2013 choke.
    Thanks!
    L.
    Run-Time Error Message:
    Comparison of the zipped contents of "Book2", the newly created workbook, and "L_VK_1_min", the converted legacy workbook:

    Hi asklucas,
    Are you installing mutiple version of Excel on the same computer? Can you check the wether the reference is correct in tools-reference?
    >>I believe there is some legacy metadata in vbaProject.bin, which makes Excel 2013 choke.<<
    Is it helpful that conver the XLSM to XLSX, then copy the code in to XLSX and save it to XLSM back?
    If not, I suggest that you create a new workbook and copy the orgial code into the new workbook as a workaround.
    Event if there are many workbook, we can write an application to automate this process. Here are some helpful links for your reference:
    Objects (Visual Basic Add-In Model)
    OfficeTalk: Display a List of All VBA Procedures in a Workbook from the Ribbon
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • DAQmx VBA for Excel 2003

    Hi,
    I'm trying to control a NI6128 via VBA. I'm using Excel 2003 and tried several of the samples I found in the developer Zone, none of them seem to run. I think there is a fundamental error somewhere.
    But, the VB6 drivers  suppose to run under VBA and that is suppose to work under Excel 2003?
    Peter

    Check out some of these links about programming in VBA.  You might have to make some of your own code, I haven't been able to get those examples to run either.
    http://digital.ni.com/public.nsf/allkb/B22FE2B0F9C8935286256E920073DA07?OpenDocument
    http://digital.ni.com/public.nsf/allkb/735848148B5B4964862571F5004692C7?OpenDocument
    http://digital.ni.com/public.nsf/websearch/B22FE2B0F9C8935286256E920073DA07?OpenDocument
    I hope that this helps.
    Applications Engineer
    National Instruments

  • Use VBA and Excel to open Dreamweaver HTML (CS5), find and replace text, save and close

    I wish to use VBA and Excel to programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the code view of these files, save and close them.
    I have  5000 associations between Find: x0001 and Replace: y0001 in an Excel sheet.
    I have the VBA written but do not know how to open, close and save the code view of the ####.html files. Please ... and thank you...
    [email protected]

    This is actually the code view of file ####.html that I wish to find and replace programmatically where #### is a four digit number cataloguing each painting.... In 1995 I thought this was clever... maybe not so clever now :>)) Thank you for whatever you can do Rob!
    !####.jpg!
    h2. "Name####"
    Oils on acrylic foundation commercial canvas - . xx X xx (inches) Started
    Back of the Painting In Progress </p> </body> </html>
    Warmest regards,
    Phil the Forecaster, http://philtheforecaster.blogspot.ca/ and http://phils-market.blogspot.ca/

Maybe you are looking for

  • Load Balancing on RAC Test

    Hi Team, We have 2 node ORACLE 10g RAC setup on RHEL4 We have to prepare a Load Balancing Scenario 1. How and on what basis Client Requests/load balancing are done on the oracle 10g RAC nodes 2. How to Moniotor on which node client request/tasks are

  • Is there a firmware upgrade to take USB 1.1 to USB 2 to run Egalato Video Capture

    We are running OS version 10.5.8 7 are using Elagato vidoe capture software.  The USB requirements are USB 2.0 however our USB port is USB 1.1.  We have all the required Apple software upddates.  Does anyone know of a how to upgrade the USB ports fro

  • SAP Query SQ01/2/3

    Is it at all possible to link SQ01/2/3 SAP Query to an external SQL source and table (MS SQL).

  • GeoRaster - problem w/ setModelSRID

    Hello All, I've loaded a GeoRaster from a geotiff and am trying to set the SRID on it but getting an error: ORA-13418: null or invalid parameter(s) for set functions Is this because I loaded w/o specifying a world file? I would have thought the world

  • Installing jam packs from DVD on Lion

    When I got my new iMac last year it came with Snow Leopard. At the time, I attempted to install all my jam packs (I have all of them) and it gave me an error that Rosetta was not installed. After installing it, I was able to install my jam packs, whi