Hello,
I just want to send you my problem, if anybody can help me I will be grateful.
Here is my problem and my code:
When I launch this code everything work, but I have this user interface and I need to click on cancel for continue the code and to work.
1937741-wfajy.png
Does it possible to disable this UI? If yes what is the procedure plz? I check on forums and I don’t find a real solution about that. Some people talk about a “propreties” window but I don’t find it.
Best regards,
Tristan
here is my VBA code:
Sub
donnees2()
'
' donnees2 Macro
' En 5 étapes:
' - ouverture des fichiers (5 fichiers analysis) - OK
' - copié les données des fichiers sans en-têtes (H12) - OK
' - collé a la suite les un des autres - OK
' - fermé les fichiers - OK
' - enregistré les cumuls analysis - Ok
'
Base =
"Y:\****\***\***\***
***\***\***\" 'folder
openwbneed =
Array(Base & "PRD_Analysis.xlsx", Base &
"Services_Analysis.xlsx", Base & "SPP_Analysis.xlsx",
Base & "SPPSB_Analysis.xlsx", Base &
"ZKES_Analysis.xlsx") 'name of all files
openned =
Array("PRD_Analysis.xlsx", "Services_Analysis.xlsx",
"SPP_Analysis.xlsx", "SPPSB_Analysis.xlsx",
"ZKES_Analysis.xlsx")
Number = 0
Windows("Cumul_Analysis.xlsm").Activate
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.delete ' delete old data
'info connexion analysis
MyClient = "***"
MyUser = "*****"
MyPWD = "*****"
MyLang = "EN"
For Each AAA In openwbneed
Set newWork = Workbooks.Open(AAA)
' open all files
'analysis
---------------------------------------------------------------------------------
' Log into SAP Analysis for Excel
iAppCall =
newWork.Application.Run("SAPLogon", "DS_1", MyClient,
MyUser, MyPWD, MyLang)
' Refresh all of the data sources.
lResult =
newWork.Application.Run("SAPExecuteCommand", "RefreshData")
'--------------------------------------------------------------------------------------------
Range("H12").Select
Range(Selection,
Selection.End(xlToRight)).Select
Range(Selection,
Selection.End(xlDown)).Select
Selection.Copy
Windows("Cumul_Analysis.xlsm").Activate
If Number = 0 Then
Range("A2").PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False,
Transpose:=False
Else
Range("A2").End(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False,
Transpose:=False
End If
Number = Number + 1
Next
For Each I In openned
Workbooks(I).Close SaveChanges:=False
Next
Windows("Cumul_Analysis.xlsm").Activate
ActiveWorkbook.Save
End Sub
Bookmarks