Export Project Tasks to Excel using VBA by Custom Field
Question referring to the link:
http://social.technet.microsoft.com/Forums/projectserver/en-US/9c46458c-893f-41ba-bd46-bdb59c533f4a/export-project-tasks-to-excel-using-vba-by-custom-field?forum=project2010custprog
Help needed. I have inserted my question at this address for Andrew or anybody else to reply. Hope to hear from you.
Regards,
Chuck
Thank you Andrew for getting back to me and I have found somewhere on the net the following macro that would do the job for the version 2007. Here is a copy for those that may need it.
Option Explicit
Sub CreateMenus()
Dim cbrMain As CommandBar
Dim ctlMain As CommandBarControl
Dim ctlOLExport1 As CommandBarControl
Dim ctlOLExport2 As CommandBarControl
Dim ctlOLExport3 As CommandBarControl
Set cbrMain = Application.CommandBars.ActiveMenuBar
Set ctlMain = cbrMain.Controls.Add(Type:=msoControlPopup, Temporary:=True)
ctlMain.Caption = "Export to Outlook"
Set ctlOLExport1 = ctlMain.CommandBar.Controls.Add(Type:=msoControlButton)
With ctlOLExport1
.Caption = "Selection to Outlook tasks"
.OnAction = "Macro """ & "Export_Selection_To_OL_Tasks"""
End With
Set ctlOLExport2 = ctlMain.CommandBar.Controls.Add(Type:=msoControlButton)
With ctlOLExport2
.Caption = "Selection to Outlook appointments"
.OnAction = "Macro """ & "Export_Selection_To_OL_Appointments"""
End With
Set ctlOLExport3 = ctlMain.CommandBar.Controls.Add(Type:=msoControlButton)
With ctlOLExport3
.Caption = "Selection to Outlook notes"
.OnAction = "Macro """ & "Export_Selection_To_OL_Notes"""
End With
End Sub
Cheers!
Chuck
Similar Messages
-
I would like to execute an existing BW report from Excel (using VBA).
I would like to execute an existing BW report from Excel (using VBA) and download the results into Excel. I understand that there is an Excel Add-In which (I believe) should allow me to do this. I am an experienced user of Excel / VBA but I have virtually no experience with SAP. If someone could point me to any source of information or specific instructions I would be extremely appreciative. I've done multiple searches on the internet but everything I find seems to assume more knowledge of SAP and SAP acronyms than I possess.
Paul,
If your company (or your client's company) has an SAP license (I assume this is the case, since there would be no other reason for you to want to access an SAP system using Excel), there is a person in your company who can request an ID for you. It is called a SAP Service Marketplace userid, more commonly called an 'S' number. This person in your company is usually a Basis Administrator. Go to your SAP Basis team and ask them for access to Service Marketplace.
The common solution for your Excel analysis problem is to install the Bex Analyzer on your PC. You will need these same guys (Basis Team) to help you with getting the required SAP access, and to install the associated SAP software onto your PC.
In the meantime, here is some bedtime reading for you.
Analysis & Reporting: BEx Analyzer - Business Intelligence - SAP Library
Best Regards,
DB49 -
LSMW FOR MATERIAL MASTER USING BAPI_MATERIAL_SAVEDATA -Adding Custom Fields
Hi Gurus,
I'm developing LSMW for Material Master Upload using BAPI method.
Object:BUS1001006
BAPI:BAPI_MATERIAL_SAVEDATA
MESSAGE TYPE: MATMAS_BAPI
BASIC TYPE : MATMAS_BAPI03.
There is a requirement to use/map a custom field. Upon research custom field can be added to the parameter EXTENSIONIN and EXTENSIONINX, but I have no Idea on how to do it with LSMW. Please advise what approach is needed.
Thanks and Regards,
JayHi Gurus,
I got the following code below.
The custom field won't get updated.... Please advise on what should I do... I've checked different forums and still can't come up with the solution... Please advise..
REPORT ztest_extend_matmas1.
STRUCTURE
TABLES:
bapimathead, "Headerdata
bapi_mara, "Clientdata
bapi_marax, "Clientdatax
bapi_marc, "Plantdata
bapi_marcx, "Plantdatax
bapi_makt, "Material description
bapiparex, "Extensionstruktur
bapiparexx,
bapiret2. "Return messages
DATA:
bapi_te_mara LIKE bapi_te_mara,
bapi_te_marax LIKE bapi_te_marax,
v_file TYPE string.
INTERNAL TABLE
*to store the output data
DATA:BEGIN OF it_material_number OCCURS 0.
INCLUDE STRUCTURE bapimatinr.
DATA:END OF it_material_number.
*for materialtext
DATA:BEGIN OF it_materialdesc OCCURS 0.
INCLUDE STRUCTURE bapi_makt .
DATA:END OF it_materialdesc.
*für z-feld
DATA:BEGIN OF it_bapiparex OCCURS 0.
INCLUDE STRUCTURE bapiparex.
DATA:END OF it_bapiparex.
*für z-feldx
DATA:BEGIN OF it_bapiparexx OCCURS 0.
INCLUDE STRUCTURE bapiparexx.
DATA:END OF it_bapiparexx.
*to return messages
DATA:BEGIN OF it_return2 OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA:END OF it_return2.
DATA:BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret1.
DATA:END OF it_return.
DATA
lt_messages TYPE bapiret2_t.
PROCESSING
*bapimathead-material = it_material_number-material.
bapimathead-material = '100-2520'.
bapimathead-ind_sector = 'P'.
bapimathead-matl_type = 'AEM'.
bapimathead-basic_view = 'X'.
bapimathead-purchase_view = 'X'.
bapimathead-inp_fld_check = 'I'.
*bapimathead-BASIC_VIEW = 'X'.
*bapimathead-SALES_VIEW = 'X'.
*bapimathead-PURCHASE_VIEW = 'X'.
*bapimathead-MRP_VIEW = 'X'.
*bapimathead-FORECAST_VIEW = 'X'.
*bapimathead-WORK_SCHED_VIEW = 'X'.
*bapimathead-PRT_VIEW = 'X'.
*bapimathead-STORAGE_VIEW = 'X'.
*bapimathead-WAREHOUSE_VIEW = 'X'.
bapi_mara-matl_group = '0001'.
bapi_mara-old_mat_no = '100-251'.
bapi_mara-base_uom = 'ST'.
bapi_marax-matl_group = 'X'.
bapi_marax-old_mat_no = 'X'.
bapi_marax-base_uom = 'X'.
bapi_marc-plant = '1000'.
bapi_marcx-plant = '1000'.
it_materialdesc-langu = 'EN'.
it_materialdesc-matl_desc = 'DESC'.
APPEND it_materialdesc.
*bapi_te_mara-material = it_material_number-material.
bapimathead-material = '100-2520'.
*bapi_te_mara-zzforst = '4148'.
bapi_te_mara-material = '100-2520'.
bapi_te_mara-zzmar_field1 = '4148'.
*bapi_te_marax-material = it_material_number-material.
bapimathead-material = '100-2520'.
*bapi_te_marax-zzforst = 'X'.
bapi_te_marax-material = '100-2520'.
bapi_te_marax-zzmar_field1 = 'X'.
it_bapiparex-structure = 'BAPI_TE_MARA'.
it_bapiparex-valuepart1 = bapi_te_mara.
APPEND it_bapiparex.
it_bapiparexx-structure = 'BAPI_TE_MARAX'.
it_bapiparexx-valuepart1 = bapi_te_marax.
APPEND it_bapiparexx.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = bapimathead
clientdata = bapi_mara
clientdatax = bapi_marax
plantdata = bapi_marc
plantdatax = bapi_marcx
IMPORTING
return = it_return2
TABLES
materialdescription = it_materialdesc
extensionin = it_bapiparex
extensioninx = it_bapiparexx
returnmessages = lt_messages.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
THanks and Regards,
Jay
Edited by: jhayyy on May 17, 2011 6:54 AM -
How can I export multiple PDF fillable forms into a spreadsheet (Excel) using VBA?
Hi guys,
I never used VBA with with Adobe Acrobat. I would like a tip to start doing that. What I would like to do know is:
1 - I have multiple PDF Forms that are filled.
2 - I want all the data from those forms to be exported to Excel via VBA code.
3 - Adobe Acrobat already have an option to do that manually (Forms > Merge Data Files Into Spreadsheet) and it works perfectly.
4 - I would like to access that feature using VBA, then generate a spreadsheet.
Any tips? How can I start?
Thanks!A good place to start is Karl Heinz Kremer's blog, where he has a few examples:
http://khkonsulting.com/2010/09/reading-pdf-form-fields-with-vba/ -
Manipulating ShockwaveFlash in Excel Using VBA
I am trying to change various variables in an embedded shockwaveplayer but I cannot get the video to play through code. My code is below. Any help would be appreciated and thanks in advance.
Sub TestVideo()
On Error GoTo iErrors
Set appxl = Excel.Application
Set sht = appxl.ActiveSheet
Dim shFl As ShockwaveFlash
For Each obj In sht.OLEObjects
If InStr(obj.progID, "ShockwaveFlash") > 0 Then
Set shFl = obj.Object
shFl.LoadMovie 0, shFl.Movie 'http://www.youtube.com/watch?v=1YuH8IoqaAg&feature=feedrec_grec_index
Exit For
End If
Next
Exit Sub
iErrors:
Err.Clear
Resume Next
End Sub
Thanks againHi Mr.Thomas,
Based on my understanding, the suggestion using Regular Expressions is a very helpful. Have you fixed the issue now?
If you still have the issue about develop with Regular Expressions using VBA, I suggest that you reopen a new thread in
Visual Basic for Application forum.
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. -
BAPI Access from Excel using VBA
Im writing an excel macro (VBA) to call a bapi that populates a spreadsheet.
The user will then do some manipulation of the data collected, and then it must be sent back to sap.
The Bapi in question is BAPI_GET_USER_DETAIL
*" IMPORTING
*" VALUE(USERNAME) LIKE BAPIBNAME-BAPIBNAME
*" EXPORTING
*" VALUE(LOGONDATA) LIKE BAPILOGOND STRUCTURE BAPILOGOND
*" VALUE(DEFAULTS) LIKE BAPIDEFAUL STRUCTURE BAPIDEFAUL
*" VALUE(ADDRESS) LIKE BAPIADDR3 STRUCTURE BAPIADDR3
*" VALUE(COMPANY) LIKE BAPIUSCOMP STRUCTURE BAPIUSCOMP
*" VALUE(SNC) LIKE BAPISNCU STRUCTURE BAPISNCU
*" VALUE(REF_USER) LIKE BAPIREFUS STRUCTURE BAPIREFUS
*" VALUE(ALIAS) LIKE BAPIALIAS STRUCTURE BAPIALIAS
*" TABLES
*" PARAMETER STRUCTURE BAPIPARAM OPTIONAL
*" PROFILES STRUCTURE BAPIPROF OPTIONAL
*" ACTIVITYGROUPS STRUCTURE BAPIAGR OPTIONAL
*" RETURN STRUCTURE BAPIRET2
*" ADDTEL STRUCTURE BAPIADTEL OPTIONAL
*" ADDFAX STRUCTURE BAPIADFAX OPTIONAL
*" ADDTTX STRUCTURE BAPIADTTX OPTIONAL
*" ADDTLX STRUCTURE BAPIADTLX OPTIONAL
*" ADDSMTP STRUCTURE BAPIADSMTP OPTIONAL
*" ADDRML STRUCTURE BAPIADRML OPTIONAL
*" ADDX400 STRUCTURE BAPIADX400 OPTIONAL
*" ADDRFC STRUCTURE BAPIADRFC OPTIONAL
*" ADDPRT STRUCTURE BAPIADPRT OPTIONAL
*" ADDSSF STRUCTURE BAPIADSSF OPTIONAL
*" ADDURI STRUCTURE BAPIADURI OPTIONAL
*" ADDPAG STRUCTURE BAPIADPAG OPTIONAL
*" ADDCOMREM STRUCTURE BAPICOMREM OPTIONAL
*" GROUPS STRUCTURE BAPIGROUPS OPTIONAL
Ive Managed to glean from various sources on the internet, the various basics on doing a bapi call from VBA
Here is what i have so far.
Private Sub Fetch_User_details_Click()
'Take username in cell 2,2 and check to see it it exists.
'Display the First and Last name of the user
'Get list of all roles and their expiry dates and populate list
Dim R3, MyFunc, App As Object
Dim SEL_TAB, NAMETAB, TABENTRY, ROW As Object
Dim Result As Boolean
Dim iRow, iColumn, iStart, iStartRow As Integer
'RFC Paramaters
Dim Pusername As Variant
Dim Preturn As Variant
Dim copyFromc As String
'Clear Table Section of Spreadsheet
Worksheets("Sheet1").Select
For x = 9 To 200
For y = 1 To 8
Worksheets("Sheet1").Cells(x, y).ClearContents
Next y
Next x
'Create Server object and Setup the connection
Set R3 = CreateObject("SAP.Functions")
R3.Connection.System = ""
R3.Connection.client = ""
R3.Connection.user = ""
R3.Connection.Password = ""
R3.Connection.Language = "EN"
'Logon to SAP
If R3.Connection.logon(0, False) <> True Then
Exit Sub
End If
'R3.loglevel = 9
'R3.logfilename = "c:guilog.txt"
Set MyFunc = R3.Add("BAPI_USER_GET_DETAIL")
copyFromc = Worksheets("Sheet1").Cells(3, 2).Text
Set Pusername = MyFunc.exports("USERNAME")
Pusername.Value = copyFromc
'Call the BAPI
If MyFunc.call Then
' ok now what ?
' Process the returned data into the spreadsheet
Else
MsgBox ("Call returned FALSE")
End If
'Close Connection to SAP
R3.Connection.logoff
End Sub
To update the data ( User Role Assignements ) i will be using bapi BAPI_USER_ACTGROUPS_ASSIGN
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(USERNAME) LIKE BAPIBNAME-BAPIBNAME
*" TABLES
*" ACTIVITYGROUPS STRUCTURE BAPIAGR
*" RETURN STRUCTURE BAPIRET2
* Dieser Baustein ist gleichgestellt mit der Pflege eines Benutzers
* über die Pflegetransaktion, gepflegt werden die Felder, für die die
* Pflege erlaubt ist
I need help deciphering the data received from the bapi and then repackaging it using VBA.
I know writing this in ABAP would take less than 30 mins, but that is not an option for me.Ok, Ive made some headway
I can now Read all the data i need from SAP
Now comes the bit to write it back again. Will Update when i have a solution
Private Sub copydata_Click()
Dim x1 As Integer, x2 As Integer
'copy all data from "Copy From" to "Copy To"
'first determine how many rows contain roles
'before copying the roles, check that the destination user has no roles assigned
If Cells(9, 6).Text <> "" Then
MsgBox ("Error. Destination User already has Roles assigned.")
Exit Sub
End If
For x1 = 0 To 1000
If Cells(9 + x1, 1).Text = "" Then
Exit For
End If
Next
Worksheets("Sheet1").Range(Cells(9, 1), Cells(9 + x1 - 1, 4)).Copy _
Destination:=Worksheets("Sheet1").Range(Cells(9, 6), Cells(9 + x1, 9))
For x2 = 1 To x1
Worksheets("Sheet1").Cells(9 + x2 - 1, 8).Value = Date
Next
End Sub
Sub Mail_small_Text_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "User " & Worksheets("Sheet1").Cells(3, 7).Text & _
" Has Been Moddelled off of User " & _
Worksheets("Sheet1").Cells(3, 2).Text & " in system " & _
Worksheets("Connection").Cells(1, 2).Text & vbNewLine & vbNewLine & _
"Please Adjust Mitigating Controls Accordingly"
On Error Resume Next
With OutMail
.To = Worksheets("Connection").Cells(10, 2).Text
.CC = ""
.BCC = ""
.Subject = "User Modelled"
.Body = strbody
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Private Sub Fetch_CopyTo_User_Click()
'Take username in cell 3,7 and check to see it it exists.
'Display the First and Last name of the user
'Get list of all roles and their expiry dates and populate list
Dim R3, MyFunc, App As Object
Dim SEL_TAB, NAMETAB, TABENTRY, ROW As Object
Dim Result As Boolean
Dim iRow, iColumn, iStart, iStartRow As Integer
'RFC Paramaters
Dim Pusername As Object
Dim PAddress As Object
Dim PTable As Object
Dim Preturn As Object
Dim copyFromc As String
'Clear Table Section of Spreadsheet
Worksheets("Sheet1").Cells(5, 8).ClearContents
Worksheets("Sheet1").Cells(6, 8).ClearContents
'Create Server object and Setup the connection
Set R3 = CreateObject("SAP.Functions")
R3.Connection.System = Worksheets("Connection").Cells(1, 2).Text
R3.Connection.SystemNumber = Worksheets("Connection").Cells(2, 2).Text
R3.Connection.Destination = Worksheets("Connection").Cells(3, 2).Text
R3.Connection.HostName = Worksheets("Connection").Cells(4, 2).Text
R3.Connection.client = Worksheets("Connection").Cells(5, 2).Text
R3.Connection.user = Worksheets("Connection").Cells(6, 2).Text
R3.Connection.Password = Worksheets("Connection").Cells(7, 2).Text
R3.Connection.Language = Worksheets("Connection").Cells(8, 2).Text
'Logon to SAP
If R3.Connection.Logon(0, -1) <> True Then
MsgBox ("We Had a Logon Error")
Exit Sub
End If
'R3.loglevel = 9
'R3.logfilename = "c:\guilog.txt"
Set MyFunc = R3.Add("BAPI_USER_GET_DETAIL")
Set Pusername = MyFunc.exports("USERNAME")
Set PAddress = MyFunc.imports("ADDRESS")
Set Preturn = MyFunc.tables("RETURN")
Set PTable = MyFunc.tables("ACTIVITYGROUPS")
Pusername.Value = Worksheets("Sheet1").Cells(3, 7).Text
'Call the BAPI
If MyFunc.call Then
Dim xxx As String
Worksheets("Sheet1").Cells(5, 7).Value = PAddress.Value("FIRSTNAME")
Worksheets("Sheet1").Cells(6, 7).Value = PAddress.Value("LASTNAME")
'Get Assigned Roles
Dim datarec As Object
Dim datafld As Object
x = 9
For Each datarec In PTable.Rows
Worksheets("Sheet1").Cells(x, 6).Value = datarec("AGR_NAME")
Worksheets("Sheet1").Cells(x, 7).Value = datarec("AGR_TEXT")
Worksheets("Sheet1").Cells(x, 8).Value = datarec("FROM_DAT")
Worksheets("Sheet1").Cells(x, 9).Value = datarec("TO_DAT")
x = x + 1
Next
copydata.Enabled = True
Else
MsgBox ("Error Calling Function - Probably Authorizations")
End If
'Close Connection to SAP
R3.Connection.logoff
End Sub
Private Sub Fetch_User_details_Click()
'Take username in cell 3,2 and check to see it it exists.
'Display the First and Last name of the user
'Get list of all roles and their expiry dates and populate list
Dim R3, MyFunc, App As Object
Dim SEL_TAB, NAMETAB, TABENTRY, ROW As Object
Dim Result As Boolean
Dim iRow, iColumn, iStart, iStartRow As Integer
'RFC Paramaters
Dim Pusername As Object
Dim PAddress As Object
Dim PTable As Object
Dim Preturn As Object
Dim copyFromc As String
'Clear Table Section and other areas of Spreadsheet
Worksheets("Sheet1").Select
For x = 9 To 1000
For y = 1 To 9
Worksheets("Sheet1").Cells(x, y).ClearContents
Next y
Next x
Worksheets("Sheet1").Cells(5, 2).ClearContents
Worksheets("Sheet1").Cells(6, 2).ClearContents
Worksheets("Sheet1").Cells(5, 7).ClearContents
Worksheets("Sheet1").Cells(6, 7).ClearContents
copydata.Enabled = False
'Create Server object and Setup the connection
Set R3 = CreateObject("SAP.Functions")
R3.Connection.System = Worksheets("Connection").Cells(1, 2).Text
R3.Connection.SystemNumber = Worksheets("Connection").Cells(2, 2).Text
R3.Connection.Destination = Worksheets("Connection").Cells(3, 2).Text
R3.Connection.HostName = Worksheets("Connection").Cells(4, 2).Text
R3.Connection.client = Worksheets("Connection").Cells(5, 2).Text
R3.Connection.user = Worksheets("Connection").Cells(6, 2).Text
R3.Connection.Password = Worksheets("Connection").Cells(7, 2).Text
R3.Connection.Language = Worksheets("Connection").Cells(8, 2).Text
'Logon to SAP
If R3.Connection.Logon(0, -1) <> True Then
MsgBox ("We Had a Logon Error")
Exit Sub
End If
'R3.loglevel = 9
'R3.logfilename = "c:\guilog.txt"
Set MyFunc = R3.Add("BAPI_USER_GET_DETAIL")
Set Pusername = MyFunc.exports("USERNAME")
Set PAddress = MyFunc.imports("ADDRESS")
Set Preturn = MyFunc.tables("RETURN")
Set PTable = MyFunc.tables("ACTIVITYGROUPS")
Pusername.Value = Worksheets("Sheet1").Cells(3, 2).Text
'Call the BAPI
If MyFunc.call Then
Dim xxx As String
Worksheets("Sheet1").Cells(5, 2).Value = PAddress.Value("FIRSTNAME")
Worksheets("Sheet1").Cells(6, 2).Value = PAddress.Value("LASTNAME")
'Get Assigned Roles
Dim datarec As Object
Dim datafld As Object
x = 9
For Each datarec In PTable.Rows
Worksheets("Sheet1").Cells(x, 1).Value = datarec("AGR_NAME")
Worksheets("Sheet1").Cells(x, 2).Value = datarec("AGR_TEXT")
Worksheets("Sheet1").Cells(x, 3).Value = datarec("FROM_DAT")
Worksheets("Sheet1").Cells(x, 4).Value = datarec("TO_DAT")
x = x + 1
Next
Else
MsgBox ("Error Calling Function - Probably Authorizations")
End If
'Close Connection to SAP
R3.Connection.logoff
End Sub
Private Sub UpdateSap_Click()
End Sub -
I am trying to do an RFC call from Excel to SAP using VBA. RFC is working fine for most the RFC enabled Function Modules except DDIF_FIELDINFO_GET and DDIF_FIELDLABEL_GET.
What can be the reason for this?
Can someonme please help me with a macro code where these FMs are working.
Also can someone please help me with some tutorial on SAP connection with Excel.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Nov 12, 2008 9:14 AMHello Jon.
DDIF_FIELDINFO_GET is not working for me either. But I have used another FM (/ZOPTION/LIVE_DDIF_FIELDINFO):
Public Sub RFC_FIELDINFO()
Dim Func As Object
Dim sapConn As Object
Dim tblFIELDTAB
Dim tblFIXED_VALUES
Dim intRow%
Dim intCol%
'* Sub : Call FM /ZOPTION/LIVE_DDIF_FIELDINFO *
'* Author : Holger Köhn *
'* Created : 23.08.2014 *
'* Changed : *
ThisWorkbook.Sheets("TEST").Activate
Cells.Select
Selection.ClearContents
ThisWorkbook.Sheets("TEST").Range("A1").Select
'* create RFC-Connection *
Set sapConn = CreateObject("SAP.Functions")
sapConn.Connection.RfcWithDialog = True
If sapConn.Connection.LogOn(1, False) <> True Then
MsgBox "Cannot Logon to SAP"
Exit Sub
End If
DoEvents
'* run FM /ZOPTION/LIVE_DDIF_FIELDINFO *
Set Func = sapConn.Add("/ZOPTION/LIVE_DDIF_FIELDINFO")
Func.Exports("TABNAME") = "AUFK"
Set tblFIELDTAB = Func.Tables("FIELDTAB")
If Func.Call = False Then
MsgBox Func.Exception
Exit Sub
Else
Application.ScreenUpdating = False
For intCol = 1 To tblFIELDTAB.ColumnCount
ThisWorkbook.Sheets("TEST").Cells(1, intCol).Value = tblFIELDTAB.ColumnName(intCol)
Next
If tblFIELDTAB.RowCount > 0 Then
For intRow = 1 To tblFIELDTAB.RowCount
For intCol = 1 To tblFIELDTAB.ColumnCount
ThisWorkbook.Sheets("TEST").Cells((intRow + 1), intCol).Value = tblFIELDTAB(intRow, intCol)
Next
Next
ThisWorkbook.Sheets("TEST").Activate
End If
Columns.AutoFit
Application.ScreenUpdating = True
End If
'* clear tblFIELDTAB *
Do Until tblFIELDTAB.RowCount = 0
Call tblFIELDTAB.Rows.Remove(1)
Loop
Set sapConn = Nothing
Set Func = Nothing
Set tblFIELDTAB = Nothing
End Sub -
VBA - Setting Custom Fields For Sub-Projects Using a Master File
Hello,
I was wondering if anyone had any experience or could provide some help with a Macro to set the Custom Fields in Sub-Project Files directly from the Macro. I had this macro working in the past with Project 2007, but it has been a couple years and I am struggling
to resolve an error. I am currently running Project 2010 with SP2. I intend to use this Macro in our Server 2010 environment, however at this time, I'm testing locally on my desktop.
Scenario.
I have a Master File with 2 sub-project (Project A, and Project B) inserted. While working in the Master File, I create a custom field title "TEAM Lookup". While in the Master File and without having to individually go and open, edit, save, and
close each sub-project, push the custom field down to the project files.
ERROR: Currently, the Macro will run and I can step through the lines of code until line 12 where I'm asking Project to use the organizer to shift the newly created custom field from the Master File to a sub-project. The line appears to
populate correctly, but instead of continuing through the loop, an error is caught (ID - 1101 - "The File (Master File) was not found")
Any ideas or suggestions would be greatly appreciated. Thanks
Sample Code
1. Sub CopyCustomFieldToSubprojects()
2. Dim MASTER, custfield, contin, AllDone
3. Dim SubProj As Subproject
4. Alerts False
5. MASTER = ActiveProject.Name
6. Application.EnableCancelKey = pjInterrupt
7. custfield = CustomFieldGetName(ActiveCell.FieldID) & ActiveCell.FieldName
8. On Error GoTo errhand
9. contin = MsgBox("This macro will copy the field " & "(" & custfield & ")" & " (the currently selected field) to all subprojects in this consolidated schedule." & vbCrLf & vbCrLf & "Be
patient, it may take more than 70 seconds to run. You will be notified when it's done. Continue?", vbOKCancel)
10. If contin = vbCancel Then GoTo done
11. For Each SubProj In ActiveProject.Subprojects
12. OrganizerMoveItem Type:=pjFields, FileName:=MASTER, ToFileName:=SubProj.SourceProject.Name, Name:=custfield
13. Next SubProj
14. AllDone = MsgBox("The " & custfield & " field has been copied to all subprojects.", vbOKOnly)
15. GoTo done
16. errhand:
17. ret = err.Description
18. ret1 = err.Number
19. done:
20. End SubSGBlaine,
Project VBA can get rather fussy about some things so you just have to find out what it wants and then adjust your code accordingly. The following will work:
Note the tweaks to the custfield variable and to the MASTER and source project names. Also when working with strings in VBA it is a good idea to eliminate at least one little gotcha, the need for exact capitalization. Therefore I always add the Option Compare
Text statement. In your macro it won't make any difference since you do not directly create a string value, but it's good practice to have the option.
Option Compare Text
Sub CopyCustomFieldToSubprojects()
Dim MASTER, custfield, contin, AllDone
Dim SubProj As Subproject
Alerts False
MASTER = ActiveProject.FullName 'FullName includes the path, now it can find it
Application.EnableCancelKey = pjInterrupt
custfield = CustomFieldGetName(ActiveCell.FieldID) & " (" & ActiveCell.FieldName & ")"
'strings are very fussy, it has to be exact
On Error GoTo errhand
contin = MsgBox("This macro will copy the field " & "(" & custfield & ")" & " (the currently selected field) to all subprojects in this consolidated schedule." & vbCrLf & vbCrLf & "Be
patient, it may take more than 70 seconds to run. You will be notified when it's done. Continue?", vbOKCancel)
If contin = vbCancel Then GoTo done
For Each SubProj In ActiveProject.Subprojects
OrganizerMoveItem Type:=pjFields, FileName:=MASTER, ToFileName:=SubProj.SourceProject.FullName, Name:=custfield
Next SubProj
AllDone = MsgBox("The " & custfield & " field has been copied to all subprojects.", vbOKOnly)
GoTo done
errhand:
ret = Err.Description
ret1 = Err.Number
done:
End Sub
John -
Exporting Cross-Tab to Excel using RAS 9.0 - incorrect and data loss
Hello,
Hope somone can help to solve the following issue.
Develop a cross-tab report using Crystal Report Developer 9.0. service pack 5 or above.
(1). Viewing in Crystal Report - no problem - all rows and columns displayed correctly.
(2). Export to Excel using Crystal Report - no problem - all rows and columns exported correctly.
(3). Viewing in RAS 9.0 - no problem, all rows and columns displayed correctly.
(4). Export to Excel using RAS 9.0 - problem - only one or two rows with last rows are exported but wrong data. Most columns are not exported. Seems like exporting errors.
RAS 9.0 was patched with hotfix 200603 and service pack 5.
Please help or is there any hotfix or service pack that resolved this problem? As developer, we can use crystal report for exporting but for users, their only choice is through RAS.
Thank you very much!Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Error occurred while finding users using API with custom field
Hi All,
I am getting the following error while searching user using API with custom attribute. Did anybody faced the same problem before ?
Hashtable<Object,Object> env = new Hashtable<Object,Object>();
env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, "t3://localhost:14000");
System.setProperty("java.security.auth.login.config","C:\\Oracle\\Middleware\\Oracle_IDM1\\designconsole\\config\\authwl.conf");
System.setProperty("OIM.AppServerType", "wls");
System.setProperty("APPSERVER_TYPE", "wls");
tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env, "xelsysadm", "Weblogic123$");
OIMClient client = new OIMClient(env);
client.login("xelsysadm", "Weblogic123$".toCharArray());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
Hashtable mhSearchCriteria = new Hashtable();
mhSearchCriteria.put("USR_UDF_ACTUALSTARTDATE",formatter.format(date));
tcResultSet moResultSet = moUserUtility.findAllUsers(mhSearchCriteria);
printTcResultSet(moResultSet,"abcd");
log4j:WARN No appenders could be found for logger (org.springframework.jndi.JndiTemplate).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" Thor.API.Exceptions.tcAPIException: Error occurred while finding users.
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:237)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl_1036_WLStub.findAllUsersx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
at com.sun.proxy.$Proxy2.findAllUsersx(Unknown Source)
at Thor.API.Operations.tcUserOperationsIntfDelegate.findAllUsers(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.security.Security.runAs(Security.java:41)
at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
at com.sun.proxy.$Proxy3.findAllUsers(Unknown Source)
at oim.standalone.code.OIMAPIConnection.usersearch(OIMAPIConnection.java:209)
at oim.standalone.code.OIMAPIConnection.main(OIMAPIConnection.java:342)
Caused by: Thor.API.Exceptions.tcAPIException: Error occurred while finding users.
at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.findAllUsers(tcUserOperationsBean.java:4604)
at Thor.API.Operations.tcUserOperationsIntfEJB.findAllUsersx(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1614.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy347.findAllUsersx(Unknown Source)
at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl.findAllUsersx(Unknown Source)
at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Thank youHi J,
Thanks for the reply. But the code is working fine for OOTB attributes and for 11g API i am getting permission exception
Exception in thread "main" oracle.iam.platform.authz.exception.AccessDeniedException: You do not have permission to search the following user attributes: USR_UDF_ACTUALSTARTDATE.
at oracle.iam.identity.usermgmt.impl.UserManagerImpl.search(UserManagerImpl.java:1465)
at sun.reflect.GeneratedMethodAccessor1034.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy366.search(Unknown Source)
at oracle.iam.identity.usermgmt.api.UserManagerEJB.searchx(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1449.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy365.searchx(Unknown Source)
at oracle.iam.identity.usermgmt.api.UserManager_nimav7_UserManagerRemoteImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at oracle.iam.identity.usermgmt.api.UserManager_nimav7_UserManagerRemoteImpl.searchx(Unknown Source)
at oracle.iam.identity.usermgmt.api.UserManager_nimav7_UserManagerRemoteImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: oracle.iam.identity.exception.SearchAttributeAccessDeniedException: You do not have permission to search the following user attributes: USR_UDF_ACTUALSTARTDATE.
at oracle.iam.identity.usermgmt.impl.UserManagerImpl.search(UserManagerImpl.java:1462)
... 44 more -
Alternative Account number - using as a custom field/Issues in reports pull
Hi All,
Requirement:
Create a new field in the GL master that will link through to a new 8 to 10 character new Chart of Accounts (COA).
We are presently using the "Group Account number" field from the GL master for reporting purposes through a Group COA. So this won't be available for our new purpose. Instead of creating a custom field and pulling the data, I'm thinking to use Country Chart of Accounts to fill this gap by using "Alternative Account Number" in GL Control data tab.
I created a new Country COA and assigned it to Operational COA. Created new GL account (FS00) and also created a new Country Chart of Accounts (FSP0) at Chart of Accounts level and assigned this to the created GL (FS00). In this process I got couple of issues
1) System didn't allow me to assign Country COA GL if already has the balance, and tried to change this error message in OBA5 without success. How can I add newly crated Alternative a/cs to the existing (balanced) GL A/cs?
2) This time I created brand new GL a/c and added the alternative a/c and created new Financial Statement Version (FSV) assigned the newly crated a/cs but I couldn't run the reports on this new COA, getting following error message "Company codes and charts of accounts entered are incompatible" when executing F.01/F.08.
3) May be silly to ask - why we are not maintaining the Alternative a/c at Company Code level (FSS0)? Why we are only maintaining at Chart of Accounts level (FSP0)?
Would be glad if any one touch this area deep enough to understand easilyHi
The system will update the amount at company code level GL only. You can post the entries at company code gl only, no option to post the transaction figures at chart of accounts level. So the group COA or country level COA will pick up the transactional data from the GL at country level. Remaining level GLs are link with the country level COA. -
Can Me_REQ_POSTED (in ME54) be used to modify custom fields in EBAN?
Hi ,
I have a requirement that I have to validate the approver authorization when he tries to approve the PR. I am using the badi ME_REQ_POSTED and the method is 'POSTED'. I have created a z implemetation including this method and the validation are working fine, But at the same time I need to update some custom fields while this check in the BADI.
I have tried BAPI_PR_CHANGE, direct using update statement but still unable to update the custom fields in EBAN TABLE.
I have noticed that at point of update custom field is getting updated but when later on the release status gets updated from the system my custom field value also vanishes.After BAPI you need to use CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Are you using it?
Apps -
Post Author: shark70
CA Forum: Desktop Intelligence Reporting
Hi
The vba below saves a file into excel then does some formatting but I need to use the saveas function to set a password for the excel file when opening.
The code in bold is where I am getting stuck
Any ideas on where I'm gioing wrong, I'm fairly new to vba unfortunately
Cheers
Sub SetantaDSAT()
ActiveDocument.RefreshActiveDocument.SaveAs ("K:\CLIENTS (LIVE)\Setanta\08. New Daily Reports\DTT and DSAT Case Type Reports\2008\May 08\") & Format(Date, "ddmmyyyy") & "_" & " TestSetanta DTT Case Type_Subtype Analysis" & ".xls"
Set xlsApp = CreateObject("Excel.Application")xlsApp.Visible = TruexlsApp.Workbooks.Open ("K:\CLIENTS (LIVE)\Setanta\08. New Daily Reports\DTT and DSAT Case Type Reports\2008\May 08\") & Format(Date, "ddmmyyyy") & "_" & " TestSetanta DTT Case Type_Subtype Analysis" & ".xls"
With xlsApp.Worksheets("DSAT Case Type").Activate.ActiveWindow.DisplayGridlines = False.Columns("B:B").EntireColumn.AutoFit.Columns("C:C").EntireColumn.AutoFit.ActiveWindow.Zoom = 75.ActiveWorkbook.SaveAs Filename:="C:\James\Check\Book22.xls", _ FileFormat:=xlNormal, Password:="test", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=FalseEnd With
End Subone other thought is that you can create text files with a batch process inside of acrobat. Advanced ---> Document Processing ----> Batch Processing.
Choose new sequence, give it a name
Step 1: Select Commands ----> Choose "execute javascript", then hit "Add." Click on "Execute Javascript" that was just added on the right, then hit the edit button and toss in the script below that I grabbed from the javascript samples (also, if your docs have multiple pages you'll need to embed the for loop into another for loop that cycles through each page). You'd also want to change the name of the saved txt file to the name of pdf you're doing it to. It shouldn't be that hard, but I'm guessing you're probably alot more familiar with VBA then javascript which is why you're choosing to do it from excel. I'm kind of in the same boat of having written a bunch of VBA, but not much javascript. I highly recommend investing some time into learning acrobat scripting b/c VB does have it's limitations when it comes to messing with PDF's.
* function to extract the text content of the current page and save to a file.
try {
var p = this.pageNum;
var n = this.getPageNumWords(p);
app.alert("Number of words in the page: " + n);
var str = "";
for(var i=0;i<n;i++) {
var wd = this.getPageNthWord(p, i, false);
if(wd != "") str = str + wd;
// save the string into a data object
this.createDataObject("whatever.txt",str);
// pop up a file selection box to export the data
this.exportDataObject("whatever.txt");
// clean up
this.removeDataObject("whatever.txt");
} catch (e) {
app.alert(e) -
Importing Structure field values in Excel using VBA and SAP RFC
I am calling a RFC MEASUREM_DOCUM_RFC_SINGLE_001 from Excel VBA. The export parameters of the RFC has a parameter MEASUREMENT_DOCUMENT and structure COMPLETE_DOCUMENT. I am able to get back parameter value in excel from RFC using
ActiveCell = Funct.imports("MEASUREMENT_DOCUMENT")
Now I want to get the value of one of the fields say POINT of the structure COMPLETE_DOCUMENT in Excel. The following code doesnt work
ActiveCell = Funct.imports("COMPLETE_DOCUMENT-POINT")
It gives an error.
Even I have tried to using code for tables
dim tab as object
set tab = funct.tabels("COMPLETE_DOCUMENT")
but it did'nt work.
Can any one help me how to access the field value of a structure?
regards
RavindraI am calling a RFC MEASUREM_DOCUM_RFC_SINGLE_001 from Excel VBA. The export parameters of the RFC has a parameter MEASUREMENT_DOCUMENT and structure COMPLETE_DOCUMENT. I am able to get back parameter value in excel from RFC using
ActiveCell = Funct.imports("MEASUREMENT_DOCUMENT")
Now I want to get the value of one of the fields say POINT of the structure COMPLETE_DOCUMENT in Excel. The following code doesnt work
ActiveCell = Funct.imports("COMPLETE_DOCUMENT-POINT")
It gives an error.
Even I have tried to using code for tables
dim tab as object
set tab = funct.tabels("COMPLETE_DOCUMENT")
but it did'nt work.
Can any one help me how to access the field value of a structure?
regards
Ravindra -
Open Multiple PDFs from within excel using VBA
Hi,
I'm using excel 2010 and would like to open pdfs based on filenames I have listed in excel.
I attached a little of my code below which gives an idea of what I'm doing.
First question:
Is there a way to open mutiple files so that they are in one "instance" of adobe?
The way this currently works, is it opens up a whole new window for each file which can make desktop very cluttered.
Second question:
Our pdfs are actually in Sharepoint and so what I am first doing, is converting the URL to point to a mapped directory of the Sharepoint Site.
For this to work, the user must first map the sharepoint directory to a specific drive letter.
I'm wondering if there's a way to pass an actual URL via a shell command so I can skip the mapped drive bit? When I try it, it doesn't open the file.
Thanks!
My current vba:
'sFileName = full URL of the file in sharepoint
'Replace URL with Mapped Directory
sFileName = Replace(sFileName, "http://aamteams.alv.autoliv.int/sites/alvgmbu/", "A:\")
'Replace slashes in URL
sFileName = Replace(sFileName, "/", "\")
'Test if file exists before opening so adobe doesn't hang up on opening
If Dir(sFileName) = "" Then
A81_Try_Opening_In_Adobe = False
Exit Function
End If
l_strProg = GetDefaultProgram(sFileName)
'Execute function to open PDF
Shell l_strProg & " " & sFileName, vbNormalFocusHi Test,
We would like to open directly in adobe for the following reasons:
1. The users like opening our pdfs in adobe over browsers by a large margin.
2. If we use a mapped drive and adobe, you can see the filenames in the start bar which is important when you have multiple files.
If you open in browser (like we do today), you only see the left side of URL
Left side of URL is always the same so it does no good to see what file your in.
3. We have had issues where sometimes the pdfs open "blank" until I refresh the browser.
4. We are also looking for a way to make a local cache of most common files for faster loads.
But maybe I will give shell execute a try if it can find a local copy first in the code.
Then open in browser as last resort.
Using either shell or shell execute, is it possible to open multiple adobe files in the same instance or will we always have to get one instance for every pdf?
Thanks for the help!
Maybe you are looking for
-
Music/movies on external hard drive and internal hard drive
I moved my itune library to an external drive using the recommended method (consolidate, etc.) quite awhile ago. Everything is working fine with that. However, at some point, apparently when the external drive was not connected, new music and movies
-
This is totally insane!! They took someone's money in a sec by 'MISTAKE' but haven't returned after 10days. I already have chatted with two staffs about this but different from what they promised, this still has not solved yet! My devoted time for th
-
Nm-applet not saving passwords
I have OpenBox (without gnome), and nm-applet. When I try to connect to an encrypted wireless network it just keeps asking for a password, over and over. This is the message that comes up in the terminal with me trying to connect: ** Message: No keyr
-
Runtime error Bex Query Execution
Hi guys, I'm facing an BW-BEX error, when I Execute a Bex Query that supposed to make some time to retreive data, about 30000 records, un Excel runtime error occurs with the same query but enough restricted to retreive less than 5000 records, this ti
-
Upgrade from Elements 10 - 12?
Hi Can someone please advise as to whether I can upgrade from elements 10 to 12 for free and if so how do I do this. Many thanks !