How to specify the sheet name while writing data into excel
_Workbook workbook = (_Workbook)(excelapp.Workbooks.Open(@"E:\ScriptTest\c.xlsx"));
workbook.Sheets.Add();
_Worksheet worksheet = (_Worksheet)workbook.ActiveSheet;
Line 1 Selection of excel sheet
Line 2:I am intersted in Adding the new sheet
Line3:Selection of Sheet
I want to select may be sheet 2 or sheet 3 like that
How to specify ?
And instead of just Add() can we specify name of sheet to be created also If yes how ?
Hi,
Please try the sample code:
Dim aSheet As Worksheet
Set aSheet = Worksheets.Add()
aSheet.Name = "myWorksheet"
Worksheets("myWorksheet").Activate
http://msdn.microsoft.com/en-us/library/office/ff821537(v=office.15).aspx
PS:
This forum is for general questions and feedback related to Microsoft Excel, if you have more Excel develop issue, I recommend you post to MSDN forum
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.
Similar Messages
-
How to specify the target name while deploying a code in OSB-- Plz Help
Hi all,
Am working in creating a cluster environment. For my testing i created a new managed server(OSB_Server) in 9001 port in the admin console itself and that server started running. The default managed server(Admin_Server) is in 7001 port. So when i deploy a code in 7001 sb console the WSDL gets exposed in 7001 because the default admin server port is 7001. While deploying a code in service bus admin console we are not specifying the target name. So how to specify the target name while deploying the code in service bus admin console. Plz help me.
Regards
PrabhuHi Prabhu,
There are three kind of server architecture possible for OSB -
1. Single server - Everything gets deployed on Admin server itself
2. Admin Server + Single Managed Server for OSB -- OSB configuration gets deployed on OSB managed server. OSB resources (proxy service, WSDL, Schema) will remain available on OSB managed server port only and NOT on admin server port
3. Admin Server + OSB cluster -- OSB configuration gets deployed on OSB cluster. OSB resources (proxy service, WSDL, Schema) will remain available on OSB Cluster port(s) only and NOT on admin server port
Converting one type of server architecture to any other type, requires a manual tedious process, so it is suggested that you create domain accordingly i.e. if you need clusters then while creating domain itself, create OSB cluster, so that all OSB applications gets deployed to OSB cluster. I will suggest you to create a clustered domain from scratch and import the configuration from your existing domian to this new clustered domain.
You may refer-
http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15022/toc.htm
Regards,
Anuj -
Giving dynamic sheet name while importing data from Excel in OPENROWSET query
I want to import data from Excel to table in SQL server. Sheets in Excel file can have any name. I want to get data from first sheet of the excel file.
CREATE PROC CopyExcelDataToTempTable
@ExcelPath VARCHAR(1000)
AS
BEGIN
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'ad hoc distributed queries', 1;
RECONFIGURE;
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1;
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1;
INSERT INTO TempData
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
SELECT CONCAT('Excel 12.0 Xml;HDR=YES;Database=', @ExcelPath),
'SELECT * FROM [Sheet1$]');
END;
Currently I am giving Sheet1 as static name in Select statement. But my sheet name is not fixed. I want to create a dynamic query. If getting Sheet name is not possible then can we put sheet with its index in Select query? There is no front end. Whatever I
want to do is in SQL server 2012. Is there any solution for this problem?Hi Ajinkya,
To get the sheet names from an excel, you can use the Stored Procedure
SP_TABLES_EX. See the below code.
EXEC sp_addlinkedserver 'ExcelSource', '',
'Microsoft.ACE.OLEDB.12.0',
'c:\worksheet.xls',
NULL,
'Excel 8.0'
EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false'
GO
EXECUTE SP_TABLES_EX 'ExcelSource'
the names in the worksheet.xls and execute result are like below.
Table name
a
b
c
d
Regarding your description, you need the first sheet of your excel. As the result shows, the sheet names are sorted, so there’s no guarantee to get the first one. The SP can work as a workaround when there’s only one sheet in your excel or the required sheet’s
name is customized to be sorted at the top first.
If you have any question, feel free to let me know.
Best regards,
Eric Zhang -
ClassNotFoundException: while exporting data into excel sheet
Hi Experts,
While exporting data into excel sheet below error was getting even i am created jar file DC and publicpart AND j2ee
I have to deployed the JAR files on the server:
1. Created "External Library DC"
2. added my JAR files into "Libraries" folder.
3. Exposed them as Public Part.
4. Created "J2EE Library DC"
5. Refered "External Library DC" into J2EE Library DC.
6. Deployed "J2EE Library DC"
7. and lastly refered this on my Web Dynpro DC by giving Library Reference.
but still this is the errro was getting, plz any one can help regarding this what could be the problem
java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook -
Loader Info -
ClassLoader name: [ng.com/Reuse_Export_to_Excel] Parent loader name: [Frame ClassLoader] References: common:service:http;service:servlet_jsp service:ejb common:service:iiop;service:naming;service:p4;service:ts service:jmsconnector library:jsse library:servlet common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl library:ejb20 library:j2eeca library:jms library:opensql common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore interface:resourcecontext_api interface:webservices interface:cross interface:ejbserialization sap.com/tcwddispwda sap.com/tcwdcorecomp service:webdynpro service:sld library:tcddicddicservices library:com.sap.aii.proxy.framework library:tcgraphicsigs library:com.sap.mw.jco library:com.sap.lcr.api.cimclient library:sapxmltoolkit library:com.sap.aii.util.rb library:com.sap.util.monitor.jarm library:tcddicddicruntime library:com.sap.aii.util.xml library:com.sap.aii.util.misc library:tccmi Resources: /usr/sap//JC21/j2ee/cluster/server0/apps/ng.com/Reuse_Export_to_Excel/src.zip /usr/sap//JC21/j2ee/cluster/server0/apps/ng.com/Reuse_Export_to_Excel/webdynpro/public/lib/ng.comReuse_Export_to_Excel.jar Loading model: {parent,references,local} -
Regards,
Varmaclosed
-
Hi all,
I just started doing the XML Xquery programming in my SQL Server 2012 Management Studio. I executed the following code:
--query the XML Blob using a CTE (pulling from the XML file each time) Products
WITH XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'H:\Products.xml', SINGLE_BLOB) ) AS XmlData
SELECT *
FROM XmlFile
GO
I got the the following Msg:
Msg 491, Level 16, State 1, Line 4
A correlation name must be specified for the bulk rowset in the from clause.
How can I specify the correction name for the bulk rowset in my project?
Please kindly help, advise and respond.
Thanks in advance,
Scott ChangHello Scott,
You have to assign a table alias for the OPENROWSET =>
--query the XML Blob using a CTE (pulling from the XML file each time) Products
WITH XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'H:\Products.xml', SINGLE_BLOB) AS MyXML ) AS XmlData
SELECT *
FROM XmlFile
GO
Olaf Helper
[ Blog] [ Xing] [ MVP] -
How to get the sheet name in a cell?
I need to dynamically get the sheet name into a series of cells, how do I do this?
Thank you.I don't see a function that does this and the formula based solution I started working on became so convoluted that it was easier to type the name of the sheet into the cell.
Sorry,
Terry -
Error while exporting data into Excel Sheet
Hi All,
I have created a VO which is based on Query(Not based on EO) and the Query is as follows:
select f.user_name ,
f.description ,
a.currency_code,
a.amount_to ,
a.amount_from
from seacds.ar_approval_user_limits_nv a , seacds.fnd_user_nv f
where f.user_id = a.user_id
and a.document_type = 'CM'
order by 2;
Based on this VO I have created a search page which will search and returns data from the table and finally standard export button will export the data into excel sheet.
In this am searching the data based on above 5 attributes. Without entering anything in the messageTextInput if i am clicking GO button, it is returning all the data into the table region. After this if i click on Export Button, data are getting exported into Excel Sheet. It is fine.
But if i am searching the data by entering any value in any of the messageTextInput, it is returning data. But if i am clicking the Export Button then it is throwing the following error:
Exception Details.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select f.user_name ,
f.description ,
a.currency_code,
a.amount_to ,
a.amount_from
from seacds.ar_approval_user_limits_nv a , seacds.fnd_user_nv f
where f.user_id = a.user_id
and a.document_type = 'CM'
order by 2) QRSLT WHERE (( UPPER(CURRENCY_CODE) like UPPER(:1) AND (CURRENCY_CODE like :2 OR CURRENCY_CODE like :3 OR CURRENCY_CODE like :4 OR CURRENCY_CODE like :5))) ORDER BY DESCRIPTION asc
at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:71)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
## Detail 0 ##
java.sql.SQLException: Invalid column type
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7895)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7572)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8183)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:8206)
Kindly give me any idea to clear this error.
Thanks and Regards,
MyvizhiHi Myvizhi ,
Did you try running the query from back end that got generated in the error trace ? see if that query is returning desired
output .
Also would like to know if you are using oracle standard search mode i.e result based search / auto customization search ?
--Keerthi -
Is it required to specify the domain name while installing Oracle Bam
Hi all,
I am trying to install Oracle BAM. Is it neccessary to specify domain while configuring services location.
Thanks.Hi,
According to your descryption, In windows 7, the tool is migwiz.exe, namely the Windows Easy Transfer, you can modify the registry in the way listed in the post below:
http://social.technet.microsoft.com/Forums/en-US/bbf5890c-b3d7-4b38-83d8-d9a5e025fb2b/how-to-move-clientside-caching-to-a-new-location?forum=w7itproinstall
In Windows 8, Windows easy transfer is also a built in tool to migrate user profiles and user settings, but as for the offline transfer, I suggest to use the USMT for your situation.
Because with USMT you can specify the folder that you want to migrate the files to, by using an offline.xml you can set the path just as the sample listed below:
<offline>
<winDir>
<path>C:\Windows</path>
<path>D:\Windows</path>
<path>E:\</path>
</winDir>
<failOnMultipleWinDir>1</failOnMultipleWinDir>
</offline>
You can also refer t othe details at:
http://technet.microsoft.com/en-us/library/hh824880.aspx
Regards
Wade Liu
TechNet Community Support -
How to specify the job name on the command line?
Does somebody know if there is a way to specify a custom name for the job being submitted on the command line?
I know you can do it submitting the jobs in a xml file but I want to do it when I do :
$xgrid -job submit myscript param1 param2As far as EJBs are concerned, JNDI names have to be specified in the <enterprise-beans> section of the proprietary sun-ejb-jar.xml deployment descriptor. It should look like this
<enterprise-beans>
<ejb>
<ejb-name>MyEjb</ejb-name>
<jndi-name>MyEjb</jndi-name>
</ejb>
</enterprise-beans>
in order to lookup the EJB as follows
ctx.lookup("java:comp/env/ejb/MyEjb");
I hope this will help.
Regards.
Antonio. -
How to specify the file path while doing bdc recording
hi guys,
using recording we specify transaction code where we enter all the details for the screen after that we get the recording program .....i have a doubt where can we specify the path for uploading a program from a local pc.......if possible can anyone provide a simple program to explain recording to upload an excel file from the system using recordingHi Gokul,
You can use the following code to upload excel data into internal table.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_FILE
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = IT_FILE
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
CLEAR IT_FILE.
ENDIF.
In SAP Enterprise edition, You can use FM : GUI_UPLOAD.
From internal table, Data will be moved to BDCDATA and continue with BDC coding.
Reward, if useful.
Thanks,
USR -
Time Stamp problem while writing data into the excel file
Hii, All
I am taking the data from the DAQ card of the TOPSCCC with the 8 ms of scanrate for each channel and there are total 16 no of Analog channels in the Card, now i am acquiring the data from the card, time stamping it and writing it into the excel file, which is tab delimited, now the problem is, the data which are in the excel file have the same timestamp for 4 to 5 continuous records, instead we want each data with the different and continuous time stamp with same difference of time stamp between two records, mean if it is difference of 8 ms then it should be the 8 ms for all, but here it is taking the differnce of 16 ms for two samples and giving same time stamp for four to five records and that shouldn't happen, here i am attaching my vi, drivers for the cards and Excel file with the data, can you please give me any suggestion how to do it?
Please help me i require this suggestion as early as possible, i am requiring it urgently.
Thanks in Advance,
Nishant
Attachments:
2026vi.llb 319 KB
2026_ScanMultAD_Demo_time.vi 80 KB
Data.xls 357 KBHello Nishant,
that's what I meant:
Message Edited by GerdW on 05-16-2006 10:32 AM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
timestamp-array.png 2 KB -
How to convert the customized report sales price list into excel sheet
hi friends,
i am faceing the probulem in VK13 report is not conveting into excel sheet, then i developed the one customized report,
in this report i am using the tables are a506, konp,and makt, result is coming and it converted into excel sheet in my systam. when i was clik on the excel sheet icon it comming excel format it working fine and save it. But in menubar list>export> localfile and select redio button spredsheet this navigation only it print the three colums not coming the total colums,
same program test in another system it not converted into excel sheet, when i am click on excel sheet icon it's given the message is 'VIEW CAN NOT BE SWITCHED, PRODUCT NOT INSTALLED OR INTEGRATION NOT ACTIVE'. but i giving the print privew it giving the three colums only,.
In program i am using regular using reuse_alv_grid_display FM only.
sorry this qusition is repeted becuse before that one mising some text.
any one plz help me.
thanks
rajnice answer
-
Hi,
Is there a way to include the UDF in the items master data into the <<Inventory In Warehouse Report (Detailed)>> PLD?
I checked the default layout and found out all the column source type is "free text" and the content is #Item, how do I know the value of the UDF?
ThanksHi,
Some of the standard reports are hardcoded in sap. Not possible to add UDF field in PLD.
Also refer this thread Variables - Sap business one
Thanks & Regards,
Nagarajan -
Urgent :how to get the o/p from report2.5 into excel
hi all
anybody can tell me how to get the report o/p in to excel format.
please help me urgent. any example send me on [email protected]
Regards
onkarHave you tried to put this question in the report forum?
Fabrizio -
Update the source record while loading data into target
Hello Friends,
I am loading data from "staging info object" into "target info object".
I have the validation code in 'start routine' in the transformations.
During validations, if the conditions are met, I would like to load the record into target and at the same time, update one specific field of this record ( e.g. say - LoadFlag ) in the source infoobject.
I am successfully able to load the records in the target info objects.
I would like to know, how to update the record in the source-infoobject.
Can anyone please let me know the ABAP syntax for this one.?
I promise to award points.
Thank you for your time.
Pramod.Instead of ABAP you can:
a) connect the update rule to the target also to the source object as input. In this updaterule you can simple set the load indicator with a constant.
b) use an APD (TR RSANWB).
Maybe you are looking for
-
I NEED HELP.
-
How do I safely delete icloud emails on MacBook Pro
How do I delete icloud emails on notebook without the email opening?
-
I just started filming using a HVR-Z1U. What do I need to do to get my Imovie HD6.0.3 to import. All controls working, but nothing shows up on scream. I feel like Luci keeps pulling the football out right as I get ready to kick it. AAAAARRRRRGGGGGHHH
-
Dear All, I am having three class files named first.class, second.class and third.class. I will run the fist.class as - java first. The first will call the second class. The second will in turn call the third class. I want to zip all the ab
-
Adobe Encore Help does not open
Help/Adobe Encore Help in Encore 2.0 does not open. Where is the help file located, and how to access it from the Help button?