Using Excel macros & change properties
Hi,
1) my program use Excel macro via a runtime.exec(cmd). I want to use JWS to deliver new versions of application but if I have to put my macros in a jar file how can I reach them (no problem with a file propertie or with gif ressources).
2) how can I change default properties ("Dossier des applications" in French maybe Applications dir in advanced) wich is enabled in the window.
thanks a lot
Sophie
1) my program use Excel macro via a runtime.exec(cmd).
I want to use JWS to deliver new versions of
application but if I have to put my macros in a jar
file how can I reach them (no problem with a file
propertie or with gif ressources).You have a lot of options how to do this.
I would try to use the I/O APIs that reads the macro file
from a web server (InputStream is = url.openStream()) and put it
in a local file (FileOutputStream = new FileOutputStream(file)).
Of course you would need a local location where to store it, could
be hardwired, or asked from the user.
2) how can I change default properties ("Dossier des
applications" in French maybe Applications dir in
advanced) wich is enabled in the window.I do not understand what you want to do. Explain again.
Regards,
Marc
Similar Messages
-
Generate CSV automatically using excel macro
Hi,
We actually make dimension hierarchy in excel and then make a CSV file and then load it into planning application. The CSV file containing parent child relationship of dimension members and other properties are made manually.
Can anyone help me regarding how can we generate CSV file automatically using excel macro and vba editor for dimension loading purpose???
Thanks
Agniva ChatterjeeYou would need to write the VBA code yourself to populate the spreadsheet, I am not sure what you are expecting the forum to provide.
Cheers
John
http://john-goodwin.blogspot.com/ -
Execute Infopackage Through BAPI Using Excel Macro (BAPI_IPAK_START)
Hi everyone,
I have a problem when execute infopackage through BAPI using excel macro. I have create a button in macro. When this button is clicked, BAPI for trigger InfoPackage will executed (BAPI_IPAK_START) and this button will disabled.
After this process completely done (traffic indicator for the request is green in update rules), the button will enabled again.
Here the subroutine or pseudocode that i will write :
Private Sub ClickButton()
Begin
1. ThisButton.Activated = False --> Disabled Button
2. Call BAPI/custom Function Module to execute InfoPackage (BAPI_IPAK_START)
4. ThisButton.Activated = True --> Enabled Button
End
The problem is i need some statement like this between statement no 2 and statement no 4
Statement That I Want :
3. Wait Until BAPI Execute Completely
So user can click this button again only after the process is finished completely. I don't know how to do this in macro (in ABAP i know i can use "WAIT ... SECOND"), others said this can be done using event in schedule option at infopackage. Anyone,please help me.
Thank you.
Regards,
Satria BEnter that req number in RSRQ and monitor the load
or right click on the DS - manage - you will req in yellow status which is in progress and you can click on the ...takes you monitor screen
Edited by: Srinivas on Jul 6, 2010 7:51 AM -
How to run excel macros using lookout
Hi,
I want use Excel macros for generating custom reports.Is it possible to run macros using run object in lookout
thanksHi,
I am pretty sure you can activate macros in Excel using the Run object in Lookout. I can think of two ways you can do this:
1. You can setup your Excel to run macros on startup using the Auto_Activate method. In this case, you will just launch excel with your workbook using the Run object and that should run the macros automatically. No brainer!
2. To better control as to when the macros are run we can assign in Excel some shortcut keys for their launching. We then would need to simulate these keystrokes to launch our macros. This can be done using the SendKeys method and some scripting, WHS Scripting for instance. See this pos
t for a scripting example which simulates Alt+Tab keys to bring-to-front an app.
You will launch the script from the Run object and this in turn launches Excel and then simulates the keys for luanching the appropriate macros. I admit this is kinda involved, but hey it works!
Hope this helps,
Khalid -
Essbase Excel Macro's and Mxl client
Hello Folks,
We are working on 11.1.2.1 having Essbase, Planning, HFM and financial Reports & ODI. We have built the environment newly. I have a scenario where we need to run the ODI batches and run the excel macros to load some of the data. Our batches run from ODI. We have distributed environment for Hyperion servers, totally 3 servers.
Components in distributed environment:
1. Shared services, Planning, HFM client, BI Reporting tools, EAS client, Maxl,ODI(server1)
2. Essbase Server,Maxl(server2)
3. HFM(Server3)
MS office & ODI installed on Server1.
We need to run the batches using ODI & Excel Macro's to load the data.
I have setup the maxl client in Server1 for the ODI batch to use for loading data into essbase but my problem is i want to use excel macro's also same time. Is there any possibility or workaround to use both at a time on same servers?
Thanks,
TamasWhat is the error you are getting while running it from ODI? I'm assuming that you are getting some error when you said only one is working.
When you install EXCEL Add-in it is changing your path and abrorpath variables and that could be the reason why maxl is not working. If ODI is using a bat file why don't you set temporary variable and try.
in you bat file add these lines (before the maxl call, i would ad them to the start)
SET ARBORPATH=C:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient
SET PATH=%ARBORPATH%\bin;%PATH%
Regards
Celvin
http://www.orahyplabs.com -
Could not connect to Oracle database from excel macro. Getting connection not open.
Hi all,
I could not connect to oracle database using excel macro. After much R&D also, I cannot find right solution. Please help me where I am doing wrong.
Sub Button2_Click()
Dim Conn As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim Cmd As New ADODB.Command
Dim sqlText As String
Dim Row As Long
Dim Findex As Long
Dim Data As Worksheet
Dim X As Long
Dim UID As String
Dim PWD As String
Dim Server As String
Dim strCon As String
Application.Calculation = xlCalculationManual
UID = "myUserid" 'Enter the User ID
PWD = "myPassword" 'Enter the password
Server = "myHostname or myServername"
Set Data = Sheets("Sheet2")
Data.Select
Range("A:J").ClearContents
strCon1 = "Provider = Microsoft.ACE.OLEDB.12.0;DATA SOURCE=myHostName;Database=myDBname;uid=myUserid;pwd=myPassword;"
Conn.Open (strCon1)
Cmd.ActiveConnection = Conn
Cmd.CommandType = adCmdText
' Put your query next
sqlText = " select * from table "
Cmd.CommandText = sqlText
Set RS = Cmd.Execute
For X = 0 To 17
Data.Cells(1, X + 1) = RS.Fields(X).Name
Next
Do While Not RS.EOF 'this loops through the data and puts it in the spreadsheet
Row = Row + 1
For Findex = 0 To RS.Fields.Count - 1
Data.Cells(Row + 1, Findex + 1) = RS.Fields(Findex).Value
Next Findex
RS.MoveNext
Loop
Application.Calculation = xlCalculationAutomatic
Application.Calculate
End Sub
sammyI have set oci.dll in to the path specified. Prior to this I musy say that, I have 64 bit excel 2010 & installed respective drivers from the link provided http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
But
still I am facing as:-" Provider cannot be found. It may not be properly installed."
sammy -
How to change the status of test cases in Test Plan from Design to Ready using Excel VBA
HI,
How to change the status of test cases in Test Plan from Design to Ready using Excel VBAThanks Florin,
Your piece of code has worked alot, and it was very helpful in changing the Status of the Workitem to "READY" for all the Users fo the workitem.
Points have been rewarded for your help.
Process: We have acheived this using the "Work Item Exits", Usng "AFTER_EXECUTION" Method.
Note: The Exit will be executed if "exit_cancelled" statement is present/used in the work item method. if not it is not taking to the exit code. I'm unable to find the reason for it. Florin can u please explain this point.
Please check the link for adding the code in Work Item Exits.
http://wiki.sdn.sap.com/wiki/display/ABAP/ProgramExitsIn+Workflow
Please find the Code:
method IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED.
Get the context of the workitem
me->wi_context = im_workitem_context.
After execution of the workitem call the method AFTER_EXECUTION
if im_event_name eq swrco_event_after_execution.
me->after_execution( ).
endif.
endmethod.
METHOD AFTER_EXECUTION.
This method acts as the Event Handler for SWRCO_EVENT_AFTER_EXECUTION
DATA: LCL_L_WID TYPE SWW_WIID,
L_STATUS TYPE SWR_WISTAT-STATUS,
L_NEW_STATUS TYPE SWR_WISTAT,
L_SWR_MESSAG TYPE STANDARD TABLE OF SWR_MESSAG,
L_SWR_MSTRUC TYPE STANDARD TABLE OF SWR_MSTRUC.
Get work item
CALL METHOD WI_CONTEXT->GET_WORKITEM_ID
RECEIVING
RE_WORKITEM = LCL_L_WID.
L_STATUS = 'READY'.
CALL FUNCTION 'SAP_WAPI_SET_WORKITEM_STATUS'
EXPORTING
WORKITEM_ID = LCL_L_WID
STATUS = L_STATUS
USER = SY-UNAME
LANGUAGE = SY-LANGU
DO_COMMIT = 'X'
IMPORTING
NEW_STATUS = L_NEW_STATUS
RETURN_CODE = SY-SUBRC
TABLES
MESSAGE_LINES = L_SWR_MESSAG
MESSAGE_STRUCT = L_SWR_MSTRUC.
IF SY-SUBRC EQ 0.
ENDIF.
ENDMETHOD.
Thank You Once Again,
Ajay Kumar Chippa -
How to run Excel Macros using JDBC-ODBC
Hi,
I want to run the excel macros in the excel file, after I connected to excel file, using JDBC-ODBC bridge.
How macros treated here?
Help needed please..........
- RameshHow to run Excel Macros using JDBC-ODBCYou don't.
As my fuzzy understanding goes.....
Macros (excel, word, etc) run via a "OLE" extension of the script host system.
So the only way to run them is via the OLE interface. That has nothing to do with ODBC. You can write your own JNI to do that, or you might get lucky and find that someone else has written a java library to do it for you. -
Copying Graphs and Pie Charts generated in Analysis View to Email item using Excel VBA Macro Code
Hi
I am currently working on an exce VBA macro code that would help me take snapshots of the Graphs and Pie charts generated in QC for a particular application and copy the same to an email item using excel VBA macro code.
I was able to write the code to create an email item. But I have no clue of how i can take snapshot of the graphs in Analysis View using excel VBA
Any help would be highly appreciated.
Thanks in Advance
Regards
Amituseramit,
You are in the consumer end products forum. You will also want to ask your question over at the Enterprise Business Community.
Click the plus sign (+) next to Discussion Boards to drop down all the options for servers, networking and any other professionally related problems.
http://h30499.www3.hp.com/ -
Encrypt with password using an EXCEL macro
I created a PDF using a macro in EXCEL 2010. Can I encrypt the PDF using the macro? I want to encrypt all document contents and restriction permissions to high resolution printing.
Hi Ralph,
Please post the query in Microsoft forums.
You might want to refer to the below threads :
https://forum.openoffice.org/en/forum/viewtopic.php?f=30&t=54705
http://www.excelguru.ca/forums/showthread.php?1412-Need-Macro-Help-to-send-a-worksheet-as- PDF
Regards,
Rave -
Using Excel VBA to Print to PDF File?
Hi, All !!
I have an Excel VBA application that creates Excel reports. These need to be sent external to our company in PDF format. I've downloaded the Acrobat SDK and have found the VB sample for AdobePDFSilent. Unfortunately, it appears that this is written for VB or VB.Net as I don't have any of the data types available that are created in the code. However, from another forum, I've gotten some VB code that appears to do many of the processes included in the SDK sample.
The code below doesn't give me any errors, but no PDF file is created.
My VBA code
Declare Function RegOpenKeyA Lib "advapi32.dll" ( _
ByVal Key As Long, _
ByVal SubKey As String, _
NewKey As Long) As Long
Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal Reserved As Long, _
ByVal dwType As Long, _
lpData As Any, _
ByVal cbData As Long) As Long
Declare Function RegCloseKey Lib "advapi32.dll" ( _
ByVal hKey As Long) As Long
Sub TestPrintPDF()
Dim strDefaultPrinter As String
Dim strOutFile As String
Dim lngRegResult As Long
Dim lngResult As Long
Dim dhcHKeyCurrentUser As Long
Dim PDFPath As String
Const dhcRegSz As Long = 1
1 Workbooks.Open ("\\master\fnshares\bcbcm\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest\A02.xls")
2 Select Case ActiveWorkbook.Sheets.Count
3 Case 1
4 Sheets(1).Select
5 Case 2
6 Sheets(Array(Sheets(1).Name, Sheets(2).Name)).Select
7 Case 3
8 Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name)).Select
9 Case 4
10 Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name)).Select
11 Case 5
12 Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name, Sheets(5).Name)).Select
13 Case 6
14 Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, Sheets(4).Name, Sheets(5).Name, Sheets(6).Name)).Select
15 End Select
16 dhcHKeyCurrentUser = &H80000001
17 strDefaultPrinter = Application.ActivePrinter
18 PDFPath = ActiveWorkbook.Path & Application.PathSeparator 'The directory in which you want to save the file
19 strOutFile = PDFPath & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & ".pdf" 'Change the pdf file name if required. This should have the fully qualified path
20 lngRegResult = RegOpenKeyA(dhcHKeyCurrentUser, "Software\Adobe\Acrobat Distiller\PrinterJobControl", lngResult)
21 lngRegResult = RegSetValueEx(lngResult, Application.Path & "\Excel.exe", 0&, dhcRegSz, ByVal strOutFile, Len(strOutFile))
22 lngRegResult = RegCloseKey(lngResult)
23 ThisWorkbook.ActiveSheet.PrintOut copies:=1, ActivePrinter:="Adobe PDF"
24 Application.ActivePrinter = strDefaultPrinter
25 ActiveWorkbook.Close False
End Sub
From what I can determine, the lines 17 & 24 combined basically accomplish the same thing as the SaveandUpdateDefaultPrinter function in the SDK (get and save the current default printer and return it to that default after printing the PDF).
Line 20 opens the Registry key for Distiller\PrinterJobControl which is done in part of the ConvertFile function in the following SDK code.
SDK Code
Dim objDistillerRegKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot
Dim strDistillerSubKey As String = "SOFTWARE\\Adobe\\Acrobat Distiller\\PrinterJobControl"
'Open Current User's Distiller Subkey for writing
objDistillerRegKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strDistillerSubKey, True)
Line 21 sets the Registry key for Excel with the name of the PDF file to output which also appears to be done in part of the ConvertFile function in the following code.
SDK Code
If (Not objDistillerRegKey Is Nothing) Then 'set reg key value for this app and file
objDistillerRegKey.SetValue(strAppPath, strOutputFile)
objDistillerRegKey.Close()
End If
I have verified, using RegEdit, that this Registry key does get set with the desired output filename.
Line 23 prints the Excel file to PDF when done manually (this was recorded using the Excel Macro Recorder). This should be comparable to the PrintToAdobePDF function in the SDK as below.
SDK Code
Private Sub PrintToAdobePDF(ByVal InputfilePath As String)
'Prints InputFilePath to the AdobePDF printer.
'Since we just gathered all this info programmatically,
'this function assumes the file is present, that it has an
'associated application and that the current user has print privileges.
'Define properties for the print process
Dim pProcInfo As New ProcessStartInfo
pProcInfo.FileName = InputfilePath
pProcInfo.Verb = "Print"
'Make process invisible
pProcInfo.CreateNoWindow = True
pProcInfo.WindowStyle = ProcessWindowStyle.Hidden
'start print process
Dim pMyProc As Process = Process.Start(pProcInfo)
pMyProc.WaitForExit()
End Sub
These are some of the statements I can't do because I don't have a ProcessStartInfo type. What am I doing wrong or NOT doing that the PDF file is not created? I hope I've described my situation in enough, but not too much detail. Thanks for your help.
Nate BreiReinhard & Karl Heinz,
Thank you both for your responses and willingness to work with me on this problem. This is driving me crazy & is getting very frustrating. It seems that I've tried everything that people have suggested (I've also posted on a VB Forum that I subscribe to) and I'm basically doing what works for everyone else but doesn't work for me. I've got to be close.
Reinhard, regarding your last post, it doesn't appear to be a one-time setting. Everytime I come into the Printers Property box (even after I've printed a PDF document manually, that option about system & document fonts is ALWAYS turned on. If it is a registry setting, please let me know how to turn it off. I'm using Adobe Acrobat 9 Standard.
Karl Heinz, I've tried that based on my initial post (see the code there). Since your post, I tried it again. I get the same result, NO FILE is produced anywhere.
I wish I could post pictures, but evidently I can't. So, I going to post first my code (in case you want to try to recreate my problem), then the values of the variables in that code when I run it (so you can I have everything set correctly as far as I know), and finally, the values of the Registry entries that I have after I run it. So, please bear with me as the post may be a little long.
My Code
Declare Function RegOpenKeyA Lib "advapi32.dll" ( _
ByVal Key As Long, _
ByVal SubKey As String, _
NewKey As Long) As Long
Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal Reserved As Long, _
ByVal dwType As Long, _
lpData As Any, _
ByVal cbData As Long) As Long
Declare Function RegCloseKey Lib "advapi32.dll" ( _
ByVal hKey As Long) As Long
Sub TestPrintPDF()
Dim strDefaultPrinter As String
Dim strOutFile As String
Dim lngRegResult As Long
Dim lngResult As Long
Dim dhcHKeyCurrentUser As Long
Dim PDFPath As String
Const dhcRegSz As Long = 1
'Workbooks.Open ("\\master\fnshares\bcbcm\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest\A02.xls")
Workbooks.Open ("H:\A02.xls")
Select Case ActiveWorkbook.Sheets.Count
Case 1
Sheets(1).Select
Case 2
Sheets(Array(Sheets(1).Name, Sheets(2).Name)).Select
Case 3
Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name)).Select
Case 4
Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
Sheets(4).Name)).Select
Case 5
Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
Sheets(4).Name, Sheets(5).Name)).Select
Case 6
Sheets(Array(Sheets(1).Name, Sheets(2).Name, Sheets(3).Name, _
Sheets(4).Name, Sheets(5).Name, Sheets(6).Name)).Select
End Select
dhcHKeyCurrentUser = &H80000001
strDefaultPrinter = Application.ActivePrinter
'The directory in which you want to save the file
PDFPath = ActiveWorkbook.Path & Application.PathSeparator
'Change the pdf file name if required. This should have the fully qualified path
strOutFile = PDFPath & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & ".pdf"
lngRegResult = RegOpenKeyA(dhcHKeyCurrentUser, "Software\Adobe\Acrobat Distiller\PrinterJobControl", _
lngResult)
lngRegResult = RegSetValueEx(lngResult, Application.Path & "\Excel.exe", 0&, dhcRegSz, _
ByVal strOutFile, Len(strOutFile))
lngRegResult = RegCloseKey(lngResult)
ThisWorkbook.ActiveSheet.PrintOut copies:=1, ActivePrinter:="Adobe PDF"
'ThisWorkbook.ActiveSheet.PrintOut copies:=1, preview:=False, ActivePrinter:="Adobe PDF", _
printtofile:=True, collate:=True, prtofilename:=strOutFile
'Call printToPdf(strOutFile)
Application.ActivePrinter = strDefaultPrinter
ActiveWorkbook.Close False
End Sub
Sub printToPdf(PDFFilename)
' Define a postscript file name
PSFileName = "H:\TempPostScript.ps"
' Print the Excel range to the postscript file
'Dim MySheet As Worksheet
'Set MySheet = ActiveSheet
ActiveWindow.SelectedSheets.PrintOut copies:=1, preview:=False, ActivePrinter:="Adobe PDF", _
printtofile:=True, collate:=True, prtofilename:=PSFileName
' Convert the postscript file to .pdf
Set myPDF = CreateObject("PdfDistiller.PdfDistiller.1")
myPDF.FileToPDF PSFileName, PDFFilename, ""
End Sub
Values of my Variables When I Run the Code
? dhcHKeyCurrentUser
-2147483647
? strDefaultPrinter
\\tcps01p\FNT12W00 Canon 5020 PCL 5e on Ne04:
? PDFPath
H:\
? strOutFile
H:\A02.pdf
? lngResult
2280
? Application.Path & "\Excel.exe
C:\Program Files\Microsoft Office\OFFICE11\Excel.exe
? dhcRegSz
1
? Len(strOutFile)
10
? PSFileName
H:\TempPostScript.ps
? PDFFilename
H:\A02.pdf
Values of my Registry Entries (HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\PrinterJobControl)
(Default) REG_SZ (value not set)
C:\Program Files\Microsoft Office\OFFICE11\Excel.exe REG_SZ H:\A02.pdf
LastPdfPortFolder - EXCEL.EXE REG_SZ "Q:\Client Management\Client Services\New Account Fees\09 September 2010\3Q10 Rebate Ltrs\Infi\MacroTest
Note: There are a couple of other entries for documents that I've printed manually that I didn't include. Also, the last entry above, contains the value of the folder that I last manually "printed" to.
I've also noticed that I have a Registry SubKey under PrinterJobControl called DownloadFonts. However, the only entry there is:
(Default) REG_SZ (value not set)
Is this the registry key you mentioned, Reinhard?
As you can see in my code, I have 3 different methods that I've tried to print. The first one defaults everything after selecting the Acrobat PDF printer. The second sets the output filename as a PDF (basically what you suggested, Karl Heinz). The third method calls a procedure that prints to a PostScript file & then uses Distiller to print from that file to pdf. This is the method Reinhard suggested.
With the first 2 methods, I get NO error messages, but no file(s) show up. With the 3 method, I get the error about the Fonts checkbox, but it creates a 0K PostScript file. When I skip that statement and run the other 2 statements, I get a log file that says the PostScript file is empty and not PDF file was created.
YIKES... What's going on? Thanks again for attempting to help me!!!
Nate -
Running Excel macros from ABAP
Hello everyone,
I am trying to execute an Excel macro from an ABAP program. We are currently on a 46C system. While doing some research on help.sap.com I came across the method execute_macro in class i_oi_document_proxy. Ive never used methods in ABAP before and Im not really sure what Im doing. Has anyone got this to work? When I try to run the program it dumps with error OBJECTS_OBJREF_NOT_ASSIGNED.
Thanks,
Becky
Here is the program:
REPORT ztest_program.
INCLUDE ole2incl.
DATA gs_excel TYPE ole2_object .
DATA gs_wbooks TYPE ole2_object .
DATA gs_wbook TYPE ole2_object .
DATA gs_application TYPE ole2_object .
DATA: h_sheet TYPE ole2_object.
DATA: document TYPE REF TO i_oi_document_proxy.
*Name of the macro in Excel
DATA: macro_string(50) TYPE c
VALUE 'FB03process.FromTheBeginning',
no_flush TYPE c,
param_count TYPE i VALUE 0,
script_name TYPE c VALUE 'X',
error TYPE REF TO i_oi_error
OCCURS 0 WITH HEADER LINE,
retcode TYPE soi_ret_string,
error_string(50) TYPE c,
retvalue(30) TYPE c.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = text-007
EXCEPTIONS
OTHERS = 1.
CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF gs_excel 'Visible' = 1 .
GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
GET PROPERTY OF gs_wbooks 'Application' = gs_application .
*--Opening the existing document
CALL METHOD OF gs_wbooks 'Open' = gs_wbook
EXPORTING #1 = 'D:\temp\FB03process.xls' .
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
text = text-009
EXCEPTIONS
OTHERS = 1.
GET PROPERTY OF gs_excel 'ACTIVESHEET' = h_sheet.
CALL METHOD document->execute_macro
EXPORTING macro_string = macro_string
param_count = param_count
script_name = script_name
no_flush = no_flush
IMPORTING error = error
retcode = retcode
CHANGING error_string = error_string
retvalue = retvalue.
disconnect from Excel
FREE OBJECT gs_excel.
PERFORM err_hdl.
FORM err_hdl.
IF sy-subrc <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
STOP.
ENDIF.
ENDFORM. " ERR_HDLHi,
Please correct me if I am wrong but it seems that you have not fetched a handle to the document object before issuing the statement CALL METHOD document->execute_macro. Hence the error OBJECTS_OBJREF_NOT_ASSIGNED is being dislayed. If you want to use SAP Desktop Office Integration using ABAP Objects, take a look at this article at http://www.intelligenterp.com/feature/archive/ or http://www.sapinfo.net/public/en/index.php4/article/comvArticle-193333c63b4bd807d2/en/articleStatistic
Hope this helps.
Regards
Message was edited by: Shehryar Khan -
Add bookmarks to pdf file using Excel VBA
Good morning -
I have, through internet searches, created an Excel macro that prints numerous workbooks to pdf, combines them into one file and prints that file. I have been searching for the last piece, which is adding bookmarks, but have not had any luck getting any of it to work. The following is the code that I am using to add the bookmarks -
Dim avdoc, pddoc, app As Object
Dim stFile As String
Dim btitle As Boolean
Dim PDBookmark As CAcroPDBookmark
stFile = "D:\Test\Test.pdf"
Set app = CreateObject("AcroExch.app")
Set avdoc = CreateObject("AcroExch.AVDoc")
Set pddoc = CreateObject("AcroExch.PDDoc")
pddoc.Open stFile
Set avdoc = pddoc.OpenAVDoc(stFile)
Set PDBookmark = CreateObject("AcroExch.PDBookmark", "")
app.MenuItemExecute ("NewBookmark")
btitle = PDBookmark.SetTitle("Test Bookmark")
This code does insert a bookmark on the first page of the document. The bookmark title displays as Untitled instead of Test Bookmark as the code states. Can someone answer the following questions -
1. Why is the code not changing the bookmark from Untitled to Test Bookmark, and
2. How would I nodify the above code to go to a certain page then enter the bookmark.
All help is greatly appreciated. Thanks in advance for your time.Good morning Reinhard -
Thanks you very much for the help. I implemented as follows:
1. app.MenuItemExecute ("NewBookmark")
btitle = PDBookmark.GetByTitle(pddoc, "Untitled")
btitle = PDBookmark.SetTitle("Total Accessories / Hardgoods")
I added the "btitle =" due to it erroring out. However, when I step through the code and get to that line, I get the "Excel has encountered an error and needs to close" error. Is there a reference that I'm missing that you know of?
2. I was able to find the code to get to a specific page number and it is working great.
Thanks again for all of your assistance. -
Excel macro error after deploying in Weblogic
Halo,
I have written excel macros and it is working fine.
but if the same file if i try to open from hyperlink after deploying in Weblogic server , I get the error
"error occured initializing the VBA libraries.
If Microsoft Visual Basic for Applications (VBA) was not installed, or was set to Install on first use,
(advertised, or set to install on demand) you may receive this error message.
Depending on the mode of installation used and the rights of the user to change current settings,
it is possible to install VBA through Control Panel, Add/Remove Programs, Microsoft Office, Add or Remove
features. If Visual Basic for Applications is not listed as an installable feature of Office, the administrator
of your system may have disabled it so it is impossible for you to install it. If VBA is not installed,
it is impossible to run VBA applications/projects on this computer. "
1. Even though Excel VBA application is installed in my machine , why am i getting this error.??
2. I would like to know is there any way to open the excel file even though if the excel software is not installed in client machine??
Appreciate your help.
Thanks.Hi,
I do not see any reason for this to not work.
Is there any difference between the preferences for RX and RXI. Please go to "edit" -> "Preferences" -> "Security(Enhanced)" and uncheck "Enable protected mode at startup".
Are you able to open any pdf from command line with the same command:
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" <<PDF_FILE>>
Thanks,
Amish. -
Hey there, I am a chemist so Labview and programming aren't exactly my strong point.
We have a Labview program that we run to control and automated valve manifold that has a thermocouple and pressure transducer that displays the temperature and pressure on the "front panel" of the labview file we run. The temperature and pressure of the manifold changes in real time while the labview is running. We must attach a sample to the manifold, take the pressure and temperature, then record those values in an excel spread sheet, one at a time.
What I would like to do is make a key board macro in excel to automatically type in the current read out of the temperature (and another for pressure) into which ever selected excel cell you are on, so that you don't have to switch back to the labview window to look at it. I have a very basic understanding of macros in VB but I don't know how to get the labview to make the read outs available for the excel macros to find it.
Thanks for the help, Here is a screen shot of the block layout of the program.
Attachments:
back.JPG 79 KBWhy not have LV put the data in Excel for you? You can use Actvie X to do this. There is plenty of information on the forum and knowledge base on how to use Active X and reporting to Excel. Plus you have the example finder. Do you have the Report Generation Toolkit? LV7 is quite old, so I don't know if this is an option for you.
Reese, (former CLAD, future CLD)
Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Maybe you are looking for
-
Grey where there should be photo?
Ok I have a Macbook Air (OS X version 10.6.7) and a Canon DIGITAL IXUS 70. So today I tried to import 59 photos. They all appeared in preview. I then opened iPhoto and clicked import Canon DC, but when the items imported only 5 photos appeared the re
-
I've been having a particularly annoying error with ColdFusion 11, and unable to track down the source of this problem. Basically There are a few variables defined in the session scope we check with isdefined a few lines above to make sure they are d
-
IPhone 5 issue with music playback- buttons not responding
When playing music on iPhone 5 - The play/skip button on my headphones does not work when pressed. If I want to pause a song, or tap twice to skip ahead, it does nothing. The volume buttons on the headphones work, but the center button does not. It D
-
STB Defaults from channel to time... anyone else annoyed?
As of this morning, when I leave my STB on a station, anytime between 5-30 seconds, it defaults to showing the time on the front panel and not the channel I'm watching. It doesn't shut off, just defaults to the time. I don't know about others, but I
-
2 security constrains for just one servlet
I'm running weblogic 6.1 and when i secure two different methods of a servlet I only get the promp for user and pwd for the last method Could anybody tell me if I'm forgetting somethig or wheter this is a bug. <security-constraint id="security_1"> <d