Control Excel with Access (Complicated Export)

I would like to have MS Access:
Open this Excel Sheet: 
\\Cable\West-Groups\TCR\Construction\Reports\Data.xlsx
Save it as: 
\\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
Close: 
\\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
Export the table [05-Job] to the tab [Data] of
\\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
Open the Excel Sheet: 
\\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
Make the Excel Sheet Visible (this might be required from my past experience with Excel)
I know this is possible, but I don’t know where to start with the code.
Note:  Our department is using Office 2013 (if this matters)

I don't know if this helps, but I do something similar in Excel (to create and control both excel and pdf), but I can't seem to make "what I call simular commands" work in Access to control Excel.
Note:  On using just the code you gave above, I get a VB Compile Error Expected =
Sub Button31_Click()
On Error GoTo ErrorMessage:
Sheet3.Unprotect
Sheet3.Range("AE21") = Environ("USERNAME")
If UCase(Sheet3.Range("AE21")) <> UCase(Sheet3.Range("AE22")) Then
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
MsgBox "At this time, this function works for the serviceability group only"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("a6")) <> 4 Or Len(Range("a6")) = 0 Then
MsgBox "Error - City Agent"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("e6")) > 18 Or Len(Range("e6")) = 0 Then
MsgBox "Error - City Name"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("l6")) > 9 Or Len(Range("l6")) = 0 Then
MsgBox "Error = City Abbreviation"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("q6")) > 2 Or Len(Range("q6")) = 0 Then
MsgBox "Error - Head End"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("u6")) <> 2 Or Len(Range("u6")) = 0 Then
MsgBox "Error - Management Area"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("y6")) <> 2 Or Len(Range("y6")) = 0 Then
MsgBox "Error - Service Area"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
'If Len(Range("ac6")) > 5 Or Len(Range("ac6")) = 0 Then
'MsgBox "Error - Hub"
'Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
'Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
'Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
'Exit Sub
'End If
If Len(Range("ak6")) <> 2 Or Len(Range("ak6")) = 0 Then
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
MsgBox "Error - State"
Exit Sub
End If
If Len(Range("AN6")) <> 5 Or Len(Range("AN6")) = 0 Then
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
MsgBox "Error - Zip Code"
Exit Sub
End If
If Len(Range("aq6")) = 0 Then
MsgBox "Notice - Complex Code Is Missing. This is a warning only, continueing with operation"
End If
If Len(Range("aq6")) < 4 And Len(Range("aq6")) > 0 Then
MsgBox "Error - Complex Code"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("aq6")) > 5 Then
MsgBox "Error - Complex Code"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
If Len(Range("f15")) = 0 Then
MsgBox "Error - Project Name"
Exit Sub
End If
If Len(Range("as15")) = 0 Then
MsgBox "Error - Date"
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
End If
Dim Z As String
Sheet1.Unprotect
Z = Right("1000" & Sheet1.Range("K1"), 4)
Sheet1.Range("K1") = Z + 1
ActiveSheet.Unprotect
Range("a1").Value = Environ("USERNAME") & " " & Date
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Dim X As String
Dim fnm1 As String
Dim flnm As String
Dim fnm2 As String
Dim strFilePath As String
X = Sheet3.Range("BA3")
Sheets("Export").Visible = True
Sheets("eSlam").Visible = True
Sheets("Export").Select
Range("A1:BF1101").Clear
Sheets("eSlam").Select
Range("A1:BF" & X).Select
Selection.Copy
Sheets("Export").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
flnm = Right("0000" & Year(Sheet1.Range("AS15")), 4) & Right("00" & Month(Sheet1.Range("AS15")), 2) & Right("00" & Day(Sheet1.Range("AS15")), 2) & " CSV" & Z & " " & Sheet1.Range("F15")
fnm1 = Mid(ActiveWorkbook.Name, 1, InStr(ActiveWorkbook.Name, ".") - 1) 'XLS Name
Sheet4.Copy
fnm2 = ActiveWorkbook.Name
Windows(fnm1).Activate
Sheets("Template").Select
Cells(13, 6).Select
Sheets("Export").Visible = False
Sheets("eSlam").Visible = False
Windows(fnm2).Activate
strFilePath = "G:\Construction\Common\Serviceability\eSlam\" & flnm
ActiveWorkbook.SaveAs strFilePath, xlCSV
ActiveWorkbook.Close (False)
Windows(fnm1).Activate
flnm = Right("0000" & Year(Sheet1.Range("AS15")), 4) & Right("00" & Month(Sheet1.Range("AS15")), 2) & Right("00" & Day(Sheet1.Range("AS15")), 2) & " SRC" & Z & " " & Sheet1.Range("F15")
strFilePath = "G:\Construction\Common\Serviceability\eSlam\" & flnm
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strFilePath & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Windows(fnm1).Activate
MsgBox "Your CSV and PDF documents are now available in the 'G:\Construction\Common\Serviceability\Eslam\' folder."
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ErrorMessage:
MsgBox "An error occured, please save and close your file, and try again. If error continues, please contact support staff"
End Sub

Similar Messages

  • Access report export to excel shows =sum() text boxes prefixed with the textbox name

    When exporting reports from access to excel the =sum() (group and total sums) text boxes all have the text box name prefixed to them in excel. They look good in access reports. Any way to turn this off? Why is this happening?
    I've seen the same issue on 2 computers running Access 2010. I also tried this in access 2013 and had the same issue.
    See the images below as examples, the first is from access, the second is the report exported to excel.
    Access 2010 (http://i.stack.imgur.com/4roFM.png)
    Exported report viewed in Excel 2010 (http://i.stack.imgur.com/6B1zj.png)

    I've seen the same issue on 2 computers running Access 2010. I also tried this in access 2013 and had the same issue.
    Hi Scott,
    Did you use the same database file? May I know how did you create the report and those TextBoxes?
    I couldn't reproduce your problem, this is what I did:
    Create a sample table and the corresponding report. Group it by one of the field, then give it a footer section. In the footer section I inserted a TextBox and set the ControlSource property to "=Sum([fieldname])". But the name of the TextBox didn't
    show in the exported Excel file. Check the screenshots here:
    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.

  • Excel Automation with Interop - Windows Service - Microsoft Excel cannot access the file

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file:
    Unhandled exception Occured : 'Microsoft Excel cannot access the file 'bla.xls'. There are several possible reasons:
    The file name or path does not exist.
    The file is being used by another program.
    The workbook you are trying to save has the same name as a currently open workbook.'.'
    The code snippet used to open the file:
    xlApp = new Application();xlApp.Visible = false;xlApp.UserControl = false;xlApp.Application.ScreenUpdating = false;xlApp.DisplayAlerts = false;xlWorkbook = xlApp.Workbooks.Open( Filename: filePath,  UpdateLinks: 2,  IgnoreReadOnlyRecommended: true, Editable: false);
    The console app and windows service are running on a Win Server 2008 64-bit OS with Excel 2013 32-bit installed. The service is running with a special user account, which has all the right permissions on accessed files and folders. The excel process is also
    started with the same account (I cheched that one). 
    I already tried to do the following, but to no avail:
    Run excel.exe /automation -> worked fine
    Created the folders and also gave full control to the account under which the service is run (even gave full control to Everyone)
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    C:\Windows\System32\config\systemprofile\Desktop
    Configured DCOM
    Excel Application -> Identity -> Specific user account
    Excel Application -> Identity -> Interactive User
    Excel Application -> Security -> Launch permissions -> Everyone full control
    Several combinations of the above
    So I really am stuck with this problem right now. Any input on this is appreciated.

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file
    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office
    may exhibit unstable behavior and/or deadlock when Office is run in this environment.
    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side.
    If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
    You can read more about that in the
    Considerations for server-side Automation of Office article.

  • Unable to export data from Web Access Data Sheet in Sharepoint to local excel or access file

    Greetings and good morning.
    I'm going to start off in broad terms with this question because I'm not 100 percent sure what information to provide.
    Long story short, we've got a Web Access Data Sheet list hosted in a Sharepoint 2010 environment. It is accessed and used by multiple people throughout the day. It contains several thousand line item entries. I'd call it a large data sheet.
    I think the size of the data sheet is casuign some instability in the list. I'd like to be able to export a defined range of data from the list into a local excel or access file. After that, I'd delete the stuff on the Access list to improve performance.
    But...when I attempt to use the Sharepoint Action bar to export - Excel locks up/crashes. If I try to export to Access, I get a similar issue.
    Any ideas? Could anyone begin by telling me what other information is required?

    Hi,
    If you would like to export data from Access Web Database in SharePoint 2010, you could go to Design With Access page in Settings. The url in my environment is http://sp/tt/_layouts/accsrv/ModifyApplication.aspx . Then choose the Table and export it to Excel
    or Modify it in Access.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Microsoft Excel cannot access the file "-". There are several possible reasons. Windows Server 2008 R2 with Microsoft Office 2010

    I have a problem with starting the Excel Application under a particular user (service account).
    I try to schedule this C# script through an application X (not Windows Task Scheduler. And this
    application will always use a service account to run services on the server). If I run the C# script in
    command prompt under the same user, it runs. Under the application X, which uses the exact same
    user, to initiate the C# script, it fails to open the Excel application (not sufficient permission?).
    This script calls application.Workbooks.Open(<ExcelFileName>,0,false,Type.missing....). At this line
    of code, it gives the following error:
    Microsoft Excel cannot access the file "...". There are several possible reasons:
    -The file name or path does not exist.
    -The file is being used by another program.
    -The workbook you are trying to save has the same name as a currently open workbook.
    I tried all the methods that I found online as follow:
    Create directory "C:\Windows\SysWOW64\config\systemprofile\Desktop" (for 64 bit Windows) or "C:\Windows\System32\config\systemprofile\Desktop" (for 32 bit Windows).
    Changed the DCOM config for the Microsoft Excel application to include this user for Local/Remote Launch and Access.
    Enabled all macros in Excel application and set the Trust Center.
    Add the user to have full control on all folders that contain the Excel file.
    Under DCOM
    config, Microsoft Excel Application, if I modify the Identity tab to check on "This User" and enter the username/password to let Excel always run under that user. Then the application runs perfectly. However, other users can't run the excel application
    on their own with the following error: "Cannot use object linking and embedding". If I check "Use the launching user", then Excel can't be launched. No errors in the logs or events anywhere to check.
    Yet, still the same error. I think it's permission but I am not sure where and what to do for this to work.
    Now, normally, when I run this excel report, I can double-click on the file and it'd automatically run,
    save the new parameters into the current file and generate a new excel file (with date attached to the
    file name). That means there is a change (save) to the original file.
    Environment: Windows Server 2008 R2 and running Microsoft Excel 2010.
    I appreciate all your help!

    I am wondering if this has anything to do with having the user log into Excel.
    In point #5 above: Under DCOM config, Microsoft Excel Application, if I modify the Identity tab to check on "This User" and enter the username/password to let Excel always run under that user. Then the application runs perfectly. However, other
    users can't run the excel application on their own with the following error: "Cannot use object linking and embedding". If I check "Use the launching user", then Excel can't be launched. No errors in the logs or events anywhere to check.
    Because running with the launching user proposes an user to run the Excel application. However, I do not think there is any where that we can pass in the password for this user to Excel. However, this Excel has all the permissions to Excel application as
    well as the folders that have the Excel files.
    Please help!
    Thank you!

  • Access Report exporting to Excel Horizontally

    I've got a rather large report in Access, based on a couple of forms.
    When i preview it looks fine, Textboxes are all in order with the make and model then the data in text boxes in a column below.
    There are 7 columns of text boxes like this.
    When I export to a PDF, it's in the right format, 7 columns next to each other.
    When I export to Word and even a text file it works fine.
    When I export to Excel, they all go horizontal...textbox name in row 1 and all the data in row 2, clear to column IV and that's it.
    What am I doing wrong?
    Thank you for any help.
    Gee

    Hi Gee,
    According to the desription, when the report exported to Excel, the layout is incorrect.
    Based on my test, the Access doesn't export the textbox into Excel, it just export the data in the report. Here are the test steps for your reference:
    1. Create a table with some fields in Access 2013
    2. Create a reprot based on the table by default
    3. Export the report to Excel by External data->Export->Excel
    Did I misunderstood? Also a demo database to help us reproduce this issue is much appreciate.
    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.

  • Using Excel with Visual C++ 6.0 (need a graph control that behaves as much like the one in CVI as possible)

    I hate to beat this to death but I was unable to find a
    clear answer to this question.  Does NI provide Excel control from within
    Visual C++ 6.0? 
    I read that NI supports the ANSI-C library only for Visual C++ 6.0 users:
    Thread : "Re: Benifits of using measurment
    studio for VC++ 6.0?"
    NI REP : drohacek
    Quote  : "we made the decision to support Visual
    C++ 6.0 users only through the ANSI-C interface and not through the Measurement
    Studio MFC-based class libraries."
    If there is a suggested way of controlling Excel from within Measurement Studio
    for Visual C++ 6.0 then I’d love to know it. 
    If not, can a plain statement be made basically stating that if you want
    to control Excel you can’t use a Visual C++ 6.0 environment even with Measurement
    Studio support?
    With .NET of course you can just decide to have Excel support added during
    project creation.  CVI can act as an ActiveX server and easily control
    Excel just by building off the examples shipped with CVI.  I see that
    there is support, using the Measurement Studio for Visual C++ 6.0 Project Wizard,
    for taking existing CVI projects and converting them to Visual C++ 6.0 projects
    or for calling CVI libraries from a .dll from within Visual C++ 6.0.  I suppose I could do the work
    in CVI and then convert the project but I'm so deeply tied into all my MFC calls that I don't see
    how I can cleanly include the CVI libraries into my existing VC++ 6.0 projects.
    What I'm really after here is a visual graph control like the one in CVI that I
    can use from Visual C++ 6.0.  I purchased a 3rd party graph control for use
    in VC++ 6.0 that works well but isn't really visual.  I mean you can't
    enter any values in it until you run the program and fill it out programmatically. 
    Then you can see which columns are two narrow, quit the program, adjust the
    column width of your now empty control, and repeat, until you get the thing
    looking the way you want.  If I could call into Excel from within Visual
    C++ 6.0  the way I do from within .NET
    then I could use Excel to hold the table and just read in the values into my table
    control at run time.  Basically I'd use Excel as a visual development tool
    for all my tables.
    I do all my coding from within CVI and Measurement Studio for Visual C++
    6.0.  I'd use CVI for everything if I didn't depend so heavily on certain
    outside controlled C++ .dll's.  Could you please suggest then what I can
    do to get Excel support for Visual C++ 6.0?
    Last question :
    Is there any plan to ever have a NI table control like the CVI table control for
    use in Visual Studio?  One that you can
    completely set up before you do any compiling? 
    I imagine that the way Microsoft sets up their environment makes this idea impossible.  Otherwise someone would
    have come up with a truly “visual” table control before now.
    Thanks,
    Grant
    Grant M. Johnson
    Project Engineer
    LECO Corporation

    Hello Grant
    You can most certainly use Excel with VC++ 6.0. Measurement Studio won't provided you with any classes to talk to Excel in VC++ 6.0. This is because Excel allows control via Automation and you can use its automation API to do anything you need with Excel. This is what CVI uses as well.
    You can see this MSDN article on how to set this up. This mentions VC.NET, but it should work the same way.
    Here is one that talks about VC 6.0 and Excel.
    Here is a code project article about this.
    Even with .NET, you have to do thru the Excel Automation support. Excel started shipping with Primary Interop Assemblies (PIA) which are .NET wrappers about the Excel Automation object model. C++ Automation is definetely not as nice as .NET, BTW
    See this document for more information about the Excel object model.
    I would not recommend using the CVI Excel libraries if all you want to use them for is Excel automation. You will end up creating un-necessary dependencies and go through extra layers that way. You can make calls straight to Excel from VC++ without requiring CVI.
    One quick observation about your excel approach. If you decide to use Excel as your table, you might be requiring everyone who uses your application to have Excel installed on their machines. Just wanted to make sure this was acceptable to you.
    Have you looked at the Datagrid Activex control, which is one of the common controls that ships with Visual Studio? You can add it to Visual Studio by right-clicking and picking it from the list of installed activex control. If you have not already, you should check it out.
    Microsoft has made significant improvements in the number of controls they provide with .NET. They have a Datagrid control that seems to be what you need.
    Measurement Studio did add some high level classes for Excel and Word Automation that simplify some common tasks, but these exists for VS 2003 C++ and VS 2005 C++, not for VC 6.0. Underneath, we end up using the same Excel automation classes, so you can easily setup something similar for VC 6.0. Plus you can find alot of references online on how to use the Excel Automation object model with C++.
    We currently have no plans in Measurement Studio to create a table control unfortunately. I am assuming when you said graph, you actually meant table, since Measurement Studio already  provides a ActiveX graph controls for VC++ 6.0 that is very similar to the CVI graph.
    On a side note, VC++ 6.0 is really really old. Have you considered upgrading?
    To summarize
    - Yes, you can use Excel with Vc++ 6.0 without mstudio.
    - Try using the Datagrid Activex control if you just need a table.
    - Measurement Studio provides high-level excel and word classes for VC++ 6.0
    - Measurement Studio provides a graph control for VC++ 6.0 which is very similar to the CVI graph.
    - Measuremnt Studio does not have a table control.
    - VC++ 6.0 is really really old. Have you considered upgrading?
    Bilal Durrani
    NI

  • Export to excel with javascript/vbscript or with plsql(html table)

    i have searched for a way to export data from OracleXe to excel without losing formatting .
    So far i have found 2 possible relatively easy ways that i am still researching
    (i do not include the ask tom sylk format way of exporting )
    1 to export the query to a html table, while using stylesheets for formatting
    (using microsoft specific styles)
    2. use of javascript/vbscript to fill an array and write this array to excel with use
    of visual basic for applications in excel.This also provides charting capabilities.
    I am still researching this two ways, and have
    encountered a few obstacles (help would be appreciated)
    1 the first way:
    a. create a button " export to excel"
    b. create the following pl/sql procedure:
    owa_util.mime_header('application/vnd.ms-excel');
    owa_util.http_header_close;
      HTP.PRINT('<html>');
      HTP.PRINT('<head>');
      HTP.PRINT('<meta http-equiv="Content-Type" content="text/html">');
      HTP.PRINT('<title>Title of the HTML File</title>');
      HTP.PRINT('</head>');
      HTP.PRINT('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
      HTP.PRINT('<h1>Heading in the HTML File</h1>');
      HTP.PRINT('<p>Some text in the HTML file.');
      HTP.PRINT('</body>');
      HTP.PRINT('</html>');
    htmldb_application.g_page_text_generated := true;
    htmldb_application.g_unrecoverable_error := true;
    c: run the procedure conditionally based on the button  "export to excel"
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true; is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen.
    To export to excel while retaining data formatting  you have to use microsoft excel
    specific styles(Seedocumentation on the microsoft site)
    2.The second way:
    a create a pl/sql procedure or sql query.
    b use this query to fill a vbscript/javascript array with values
    c write these values to excel with use of vba in excel :
    the obstacle i encountered here was that i dont know how to export the result of a
    query to a visual basic script or javascript array.

    Using approach 1) works fine for me.
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true;
    is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen. Why is this a problem?
    I created the button to export the excel file on page 1 and created your pl/sql procedure on page 2 using an onload process.
    Works fine.
    Other approaches for exporting to excel are:
    http://www.oracle.com/technology/pub/articles/saternos_broadcast.html
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:5685133631021176591::::P54_ID:1962
    ~Dietmar.

  • Hyperion IR 11 -Export to Excel with formatting

    Hi,
    we have problem in exporting pivot sections to excel with the format intact.
    Is there really an option in Hyperion IR 11, to use this as such?
    I have a script that creates excel, by creating a MHTML And converting it to excel.
    But I need to know other options as well.
    Thanks in advance.

    Hi~
    I get the same question.
    I export pivot sections to excel with the format intact, but it did not work.
    When export pivot sections to excel can not with the format intact
    My script below:
    ActiveDocument.Sections["sectionname"].Export('C:\\test.xls',bqExportFormatOfficeMHTML,true,true);
    What is it wrong? Thanks~

  • Export to excel with formatting was autowrapping text in a cell

    Export to excel with formatting was autowrapping text in a cell without having to check the can grow option.  When the can grow option is checked it does wrap the text however it spans multiple rows, which causes complications when trying to sort. 
    It worked in:
    ProductVersion=10.0.0.533
    ProductName=Crystal Enterprise 10 Embedded
    Doesnt work in:
    Crystal Reports 10.0 Service Pack 6
    After the upgrade the reports did not autowrap, b/c the "can grow" option was not checked.  I believe this was fixed by "ADAPT00305137 Patch ID: 36479914
    Description:
    When users export to Excel 97-2000 with the page-based format, text fields are wrapped, even when the "can grow" feature in the
    Designer is turned off." .   After we turn the option to grow on it does wrap however it spans across multiple rows.  So I guess my question is there a way for it not to span multiple rows when wrapping text?
    Edited by: dforde on Jan 27, 2010 11:12 PM

    I could be wrong, but I believe the export to excel option exports the database values, and the export to HTML exports the values seen in the sheets. If the database values are stored as seconds, the Excel will see them as seconds, and the data will have to be formatted properly in Excel.
    I haven't toyed around with Excel exports that much, but it might be possible to set up a template or macro in excel that would have the proper formatting, and use it when opening the Disco export.

  • Crystal Report 10 Export Excel (with gridlines)

    Post Author: Angel Tam
    CA Forum: JAVA
    Hi,I am now using Crystal Report 10 with Java to export the report to excel format.  I can do it successfully but all the gridlines (border) are lost.  Is anybody know how to set this feature.  My source code is as follows.<%@ page contentType = "text/html; charset=UTF-8"%><%@ page import = "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument,                   java.util.,                   java.io.,                   javax.servlet.,                   javax.servlet.http.,                   com.crystaldecisions.sdk.occa.report.application.,                   com.crystaldecisions.sdk.occa.report.lib.ByteArray.,                   com.crystaldecisions.sdk.occa.report.exportoptions.,                   com.crystaldecisions.sdk.occa.report.lib." %><%/******************************************************************************************** *                Exporting the report to desired format and destination ********************************************************************************************/// Declare the PrintOutputControllerPrintOutputController poController;try {        // Retrieve the ReportClientDocument object from session        ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute("rptDoc");        // Clear ReportClientDocument object from session cache        session.setAttribute("rptDoc", null);                               // Get the print output controller object    poController = clientDoc.getPrintOutputController();     // Use the report documents PrintOutputController to export the report to a ByteArrayInputStream    // Change the int value to a ReportExportFormat    ByteArrayInputStream byteIS = (ByteArrayInputStream) poController.export(ReportExportFormat.MSExcel);    // Portable Document Format    String strExt = ".xls";                // Exported File Extension    String strMime = "application/vnd.ms-excel";    // Mime Type        // Create a byte&#91;&#93; (same size as the exported ByteArrayInputStream)    byte byteArray&#91;&#93; = new byte&#91;byteIS.available()&#93;;    // Copy the contents of the ByteArrayInputStream into a byteArray&#91;&#93;    int x = byteIS.read(byteArray, 0, byteIS.available());     response.reset();    // Clear out response stream            // Set the browser's mime type    response.setContentType(strMime);    response.addHeader("Content-disposition", "inline; filename=exported" + strExt);    // Use the SevletOutputStream to send the byteArray's data to the browser    response.getOutputStream().write(byteArray); } catch (Exception e) {    out.println("An error has occurred while exporting the report.<BR>" + e.toString());    out.println(e);}%>----
    I think these few lines may be useful to do the setting but I don't really how to use.  Hope somebody can help me.  Thank you.ExcelExportFormatOptions XLExpOpts = new ExcelExportFormatOptions();XLExpOpts.setShowGridlines(true);ExportOptions exOpts = new ExportOptions();exOpts.setFormatOptions(XLExpOpts);exOpts.setExportFormatType(ReportExportFormat.from_int(ReportExportFormat._MSExcel));Angel

    Post Author: Angel Tam
    CA Forum: JAVA
    Hi,I am now using Crystal Report 10 with Java to export the report to excel format.  I can do it successfully but all the gridlines (border) are lost.  Is anybody know how to set this feature.  My source code is as follows.<%@ page contentType = "text/html; charset=UTF-8"%><%@ page import = "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument,                   java.util.,                   java.io.,                   javax.servlet.,                   javax.servlet.http.,                   com.crystaldecisions.sdk.occa.report.application.,                   com.crystaldecisions.sdk.occa.report.lib.ByteArray.,                   com.crystaldecisions.sdk.occa.report.exportoptions.,                   com.crystaldecisions.sdk.occa.report.lib." %><%/******************************************************************************************** *                Exporting the report to desired format and destination ********************************************************************************************/// Declare the PrintOutputControllerPrintOutputController poController;try {        // Retrieve the ReportClientDocument object from session        ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute("rptDoc");        // Clear ReportClientDocument object from session cache        session.setAttribute("rptDoc", null);                               // Get the print output controller object    poController = clientDoc.getPrintOutputController();     // Use the report documents PrintOutputController to export the report to a ByteArrayInputStream    // Change the int value to a ReportExportFormat    ByteArrayInputStream byteIS = (ByteArrayInputStream) poController.export(ReportExportFormat.MSExcel);    // Portable Document Format    String strExt = ".xls";                // Exported File Extension    String strMime = "application/vnd.ms-excel";    // Mime Type        // Create a byte&#91;&#93; (same size as the exported ByteArrayInputStream)    byte byteArray&#91;&#93; = new byte&#91;byteIS.available()&#93;;    // Copy the contents of the ByteArrayInputStream into a byteArray&#91;&#93;    int x = byteIS.read(byteArray, 0, byteIS.available());     response.reset();    // Clear out response stream            // Set the browser's mime type    response.setContentType(strMime);    response.addHeader("Content-disposition", "inline; filename=exported" + strExt);    // Use the SevletOutputStream to send the byteArray's data to the browser    response.getOutputStream().write(byteArray); } catch (Exception e) {    out.println("An error has occurred while exporting the report.<BR>" + e.toString());    out.println(e);}%>----
    I think these few lines may be useful to do the setting but I don't really how to use.  Hope somebody can help me.  Thank you.ExcelExportFormatOptions XLExpOpts = new ExcelExportFormatOptions();XLExpOpts.setShowGridlines(true);ExportOptions exOpts = new ExportOptions();exOpts.setFormatOptions(XLExpOpts);exOpts.setExportFormatType(ReportExportFormat.from_int(ReportExportFormat._MSExcel));Angel

  • Office 2010 & 2007 - Excel and Access File Locking Out On the Network With Multiple Users

    This is also posted in the Office 2010 - IT Pro General Discussions, but was suggested to repost here, since a definitive answer was not found.
    Hi,
    An issue that's happening is that Excel and Access files are locking on the network. We're currently using Office 2007 and 2010.
    Here are some different scenarios that are happening:
    When opening the file it is locked out by “User X” which is the person that has the file locked out and no one else can open the file.
    When opening the file it is locked out by “User Y” which is NOT the actual person, but is locked out by “User X” and no one else can access the file.
    When opening the file  it is locked out by “…another user” which is generic and no one else can access the file.
    The two more common events are incident 1 and 2 with 3 happening the less common.
    This message will continue until the sessions are closed through computer management on the file server.
    The file server is running Windows Server 2003.
    This does happen on both Windows XP and Windows 7 clients.
    This does happen for users using Office 2007 and Office 2010.
    There are two sets of Office 2010 Users when it comes to patches. Everyone has the most current patches with Office 2010 SP2 while anyone that has Microsoft Project 2010 is using all the current update before Office 2010 SP2.
    All users that are using Office 2007 have all the current patches and service packs.
    Another variable is that we have users that will leave a file open on the network for 3+ days and after a while it will lock the file out.
    Also we have Shadow Copy that runs daily on the system which I'm not for sure if that impacts anything if a file is opening during that time.
    Any ideas on how to mitigate the lock out issues would be appreciated.
    Thanks,
    Binary Process
    Edit November 12, 2013: This issue can occur if and if not another person actually has the file open. If the person doesn't have the file open then there is a hung connection which needs to be disconnected by going to the Computer Management of the File
    server.

    Hi Binary,
    I know that the description of the hotfix does not relate to the issue. The purpose is to install it for upgrading SMB related file.
    A similar issue I encountered before:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b7fcc59b-52d9-4a02-863a-1a529bcb8cb1/temp-doc-etc-files-dont-close-after-a-file-closes-this-causes-locked-files?forum=winserverfiles
    It is resolved by upgrading SMB files so maybe it will help on your case.
    Another hotfix which may related:
    http://support.microsoft.com/kb/983458
    If you have any feedback on our support, please send to [email protected]

  • Export Excel with BO 5.1

    Post Author: mcolletm
    CA Forum: General Feedback
    Hello all, I would like to know how can I export a table results from a query on excel with BO 5.1.I know that I can do it through "save as" .txt and open this txt file with excel but I don't want this because of bad setup.I know that it is possible to export directly on excel my results but I don't know how...Are there any hidden options I don't cath? Are there any macros which can do this? Thanks in advance for your help Maxime

    Post Author: amr_foci
    CA Forum: Integrated Solutions
    go to this link and find the documentaion about ur specific version
    http://support.businessobjects.com/documentation/supported_platforms/default.asp
    u will find supported platforms and connectivites
    good luck

  • Export to Excel with Filter values

    I have implemented Prakash Darji's Exporting tips.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123
    But it very important for us to only allow the user to only export the data which is available on the table currently, basically export to excel WITH filters and not everything which is in the infoprovider.
    does anyone have a way of achieveing this?
    i was thinking of maybe somehow passing filter values in the PCD url
    Something like this?  would this work.....
    pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex.QUERY=ZTESTQUERY&FILTER_IOBJNM=0CALDAY&FILTER_VALUE='01012009'&BI_COMMAND_1BI_COMMAND_TYPE=EXPORT&BI_COMMAND_1-EXPORT_FORMAT=XLS&BI_COMMAND_1-null=

    Hi Apeksha,
    you can achieve this requirement (unless I do not know the detailled requirement) perhaps by using this way of implementation:
    1. Create a new template which contains an info_field which does a data binding to the variable values or the characteristic you want to display. Set the visibility of the top container to "hidden". Add a empty data provider to this template. However be aware that the name for the (empty) data provider must match the name of the data provider within the original template you want to print.
    2. Open your original template and include the template you created in step 1 (Advanced: Web Templates and technical name of the web template created in step 2). Choose the appropriate location (above/below the analysis item).
    3. Check the settings of your export command: do not set a special web item to be printed.
    If you export the template within web the second template should be printed correctly displaying the variable settings chosen in step 2 for the info_field.
    Brgds,
    Marcel

  • How to export an ALV to Excel with its Header and Logo?

    Hi guys,
    I need to download to excel an ALV to excel. I already know how to download the ALV part, with its propertys, fonts, colors, etc. But I don't have a clue about how to download the header and the logo.
    Any suggestion?.
    Regards,
    Eric

    Hi Eric,
    Please check this link for sample code regarding LOGO to Excel
    How to Download ALV Output LOGO to Excel ?
    For Header to Excel check this link
    Export header of alv-oo into excel
    Hope this would help you.
    Good luck
    Narin

Maybe you are looking for

  • Windows 8 hangs or freezes whenever search for anything

    Rebuild the Index Whenever you try to search for something in windows, its indexing which find the things quickly and brings that to you.If indexing is disabled or corrupt computer won't be able to search and will not present the search results.Windo

  • Error message when trying to open iTunes Store

    Is there a problem with the Aussie store? Every time I try to access the store homepage, I get this error message: We could not complete your iTunes Store request. The iTunes Store is temporarily unavailable. Please try again later. I've been getting

  • Why does my ipod nano now need a 10.5.8 system.

    I got my 4th generation ipod nano 2 years ago, and now it is not recognized on my mac 10.4.11, though it does charge up when connected. I followed all the steps in the troubleshooting manual on the apple site for this problem. I was told to get the l

  • Reading Text in the PO  line item

    Hi, I need to retrieve the Line item Text in the PO (Material PO text). Can anyone Provide me a sample code? i need to display this in a script. I could not retrive it from the Function Module READ_TEXT. Can any one help me regarding this? Regards, N

  • External FW HD won't/will mount

    Here's a little conundrum which has partly resolved itself and hopefully no longer causes a problem, but I would welcome opinions on what might be going on. I have 2 x G4 Quicksilvers and a PowerBook. G4-1 runs 9.2.1. G4-2 runs 9.2.2 and sometimes 10