ultima novità:
dove prima di richiamare e modificare il file, incolla il percorso trovato nella cella(2,8).codice:Sub rinomina() PERC = Cells(1, 8).Value I = 1 Do If Cells(I, 1).Value = "" Then Exit Do A= Cells(I, 5).Value B= Cells(I, 6).Value C= Cells(I, 3).Value D= Cells(I, 7).Value E= Cells(I, 4).Value Cells(2, 8).Value = PERC & Cells(I, 1).Value & Cells(1, 9).Value Name (PERC & Cells(I, 1).Value & Cells(1, 9).Value) As PERC & A& " - " & B& " - " & C& " - " & D& "(" & E& ")" & ".pdf" I = I + 1 Loop End Sub
ora utilizzo la sub:
quindi mi apre il file da percorso che aevo incollato e lo trova aprendolo.codice:Sub apri() Call ExecuteFile(Cells(2, 8).Value, vbNormalFocus) End Sub Public Sub ExecuteFile(FilePath As String, Stile As VBA.VbAppWinStyle) 'Esegue file On Error GoTo error Dim ret As Integer ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath)) Exit Sub error: MsgBox Err.Description, vbExclamation, "Error" End Sub![]()
nn so che fare...![]()

Rispondi quotando