Duplicate / Move sheet from Excel B to Excel A

received error below after running

Something went wrong with .
Activity Invoke VBA (Invoke V B A) failed:

Programmatic access to Visual Basic Project is not trusted

@SyafiqKCS

Give method name as "“Unwrap_Text” instead of “Main” and remove commented data in the code.
And give some range.

@SyafiqKCS

My bad, I thought all the cells would be wrapped so you got the error. Use this code instead

Sub UnwrapText()
    Dim ws As Worksheet
    Dim rng As Range
    
    Set ws = ThisWorkbook.Worksheets("Sheet1")
    
    Set rng = ws.UsedRange
    
    For Each cell In rng
        If cell.WrapText Then
            cell.WrapText = False
        End If
    Next cell
End Sub

Then use autofit range activity after the invoke code.

can u show me how to created output variable

@SyafiqKCS

Try this and let me know if its working or not.

after reviewing the process, i think i cant do this way due to “B” excel file is going to be generated for my other comp with the same format but the some item in the range could be vary so if the instruction is “fix” the next “B” excel wont produce same result. so its better if i can completely duplicate B and move to A. Im sorry if my explaination is quite hard to understand :sweat_smile:

1 Like

@SyafiqKCS

Use studio for that. You can easily duplicate the sheet.

My company right now exploring the RPA and the option I been given is using StudioX, unfortunately i cant change which apps to use as the task is using StudioX. anyway TQ for the help.