web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Formatting whole sheet...
Power Automate
Answered

Formatting whole sheet using VBScript on PAD

(0) ShareShare
ReportReport
Posted on by 136

Greetings, 

 

I would like to ask for help on how to format whole excel sheet to text using VBScript ? Its a blank excel file.

I've used this but cant really seem to work.

Workbook.Worksheets("Sheet1").NumberFormat = "@"

 

 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you please share the full script you used?

  • RookAils1 Profile Picture
    136 on at

    Sure and thx in advance.

     

     'Open the Excel app
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = False

    'Open the document via a file path variable
    Set Workbook = objExcel.Workbooks.Open("C:\****\****\Documents\Book1.xlsx")

    Workbook.Worksheets("Sheet1").NumberFormat = "@"


    'Save and close
    Workbook.Save
    Workbook.Close
    objExcel.Quit

     

     

    I got this error :

    C:\****\****\AppData\Local\Temp\Robin\jvx2sueafdg.tmp(8, 1) Microsoft VBScript runtime error: Object doesn't support this property or method: 'Workbook.Worksheets(...).NumberFormat'

     

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    .NumberFormat is not a method of the Worksheet object. It applies to a Range object. Try defining a range and using Workbook.Worksheets("Sheet1").Range("A1:Z1000").NumberFormat = "@"

     

    If you want to format the entire sheet, you can either define a range that covers the entire sheet, or use Workbook.Worksheets("Sheet1").Columns.NumberFormat = "@" as Worksheet.Columns technically returns a range object that includes all columns.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • RookAils1 Profile Picture
    136 on at

    It worked ! Thank you so much @Agnius !

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard