Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 932

How to modify these VBA codes to save excel sheet in excel format (.xlsx)?

$
0
0

I have added a button in excel sheet and now when I click that button it saves the sheet at specific path with specific name but in pdf format.

I want to save this sheet simply in excel format (.xlsx). so

Sub PDFActiveSheet2()Dim ws As WorksheetDim strFile As StringOn Error GoTo errHandlerstrFile = "m:\formats\"& Range("H8")Set ws = ActiveSheetws.ExportAsFixedFormat _    Type:=xlTypePDF, _    Filename:=strFile, _    Quality:=xlQualityStandard, _    IncludeDocProperties:=True, _    IgnorePrintAreas:=False, _    OpenAfterPublish:=FalseMsgBox "file has been created."exitHandler:        Exit SuberrHandler:        MsgBox "Could not create the file"        Resume exitHandlerEnd Sub

What do I need to change?


Viewing all articles
Browse latest Browse all 932

Trending Articles