人気ブログランキング | 話題のタグを見る

Code to save file in xlsm format [Anwsered]

Code to save file in xlsm format

I need to amend the code below so that the file saves in xlsm format.
Can someone please advise how this can be achieved?
 
Thanks
 
Paul
 
Set WB = ThisWorkbook
    Set SH = WB.Sheets("AET Sales")    '<<==== CHANGE
    Set Rng2 = SH.Range("B1")          '<<==== CHANGE
   
    If Not IsEmpty(Rng2.Value) Then
        aStr = Rng2.Value
        FName = aStr
        ThisWorkbook.SaveAs Filename:=FName, _
                            FileFormat:=xlWorkbookNormal
 
    Else
        'Your code to handle misssing data, e.g.:
        MsgBox Prompt:="Missing Data", _
                      Buttons:=vbCritical, _
                      Title:="Problem"
   
 
    End If

Solutions to the Problem Code to save file in xlsm format

Download SmartPCFixer to Fix It (Free)

No problem, just change
 
      FileFormat:=xlWorkbookNormal
to:
 
       FileFormat:= xlOpenXMLWorkbookMacroEnabled

Running System Update Readiness Command

On running the System Update readiness Command, it will Detect & Replace Incorrect Registry data with the Correct one. Which may ultimately Solve Code to save file in xlsm format in Windows.

  1. Open CMD as Administrator by Simply Right Clicking on Start button > Command Prompt (Admin).
  2. Now Type or Copy paste "DISM.exe /Online /Cleanup-image /Scanhealth" and hit Enter,
  3. Now again Type or Copy paste this "DISM.exe /Online /Cleanup-image /Restorehealth" and hit Enter.
  4. Close the Command Prompt Window because we are done.

Try and see if you still get the same error Code to save file in xlsm format in your Windows.

Note: You may be prompted to enter your administrator's password when you try to execute certain system tasks!

Recommended Method to Repair the Problem: Code to save file in xlsm format:

How to Fix Code to save file in xlsm format with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your system.  Open it, and it will perform a scan for your computer. The errors will be shown in the scan result.

2. After the scan is done, you can see the errors and problems which need to be fixed.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been removed.


Related: Cannot Connect To Sites Powered By One Server,Can't Suceed At Installing Update For Microsoft Office 32 Bit,Cannot Access Another Windows 7 Computer Over A HomeGroup Network.,Cannot Open E-mail Or Access Certain Site, Please Please Help!,Can't Use Adobe Reader 9.3 And Flash Player With Windows 7,Cannot Type Text In Msn E-mails,Cannot Roll Back To IE8 - Not There When IE9 Is Uninstalled,Cannot Print Some Sheets In Excel 2007,Canon Ip4500 Printer Win 8,Cannot Print On New Windows 7 With Old Quickbooks 7.4 Program.,Change Default Save As Location In Internet Explorer To Desired Drive/folder,Cant Click On URL Within Outlook Express To Open The Page In IE.,Checking File System C At Startup AND Black Screen With White Blinking Underscore In Top Left Corner. PLEASE HELP!!!!!!!!!!!!!!!,Cascading Styles Question,Catalyst Control Center Has Stopped Working: Host Application"
Read More: Change default language in windows 7 starter.,Cant view video in BBC news website?? help!,[Solved] Center speaker not working after Windows 8.1 update (using 5.1 surround sound),Troubleshooting:cant delete from deleted items in outlook express Error,Solution to Error: Chart with months,can't disply two pdfs at the same time,Cannot connect with RDP after configuring port forward,Cannot "Add" anything to my favorites must "Reset" IE to add anything,Cannot open crestedg.century21.com in Internet Explorer 11 on Windows 8.1,Cant get online..0x7c3efb61/0xfa8b6373
by HowToFixOutloo | 2016-09-19 17:27