▲ 3 r/vba+1 crossposts

OneDrive won't sync .docx created from macro-enabled template (.dotm) found a "workaround" (re-triggering the file, sync starts) [WORD]

>Context: I was trying to make a template for my Uni so that I don't need to manually edit anything, but I ran into two issues which I kind-of Solved

Ms Word Ver: MS Word-365 (2026)
Windows Ver: Windows 10 Pro (Home would work too maybe)
OneDrive: Uni Acc. (Personal Would work too maybe)

Problem: File Not Auto-Syncing. Error: Macro Enabled, disabling it

Fix: Just click on the 'File' Section and it will Auto-Sync

[How to use Macro/ .dotm Template]

Step 1: Make your template file first

Step 2: Save it as ".dotm" [Word will automatically save it at it's default position, re-open it and press Left-Alt + F11

Step 3: Double click on "ThisDocument" and paste the given macro with your formatting

Step 4: Save it 'CTRL+S' and exit everything, re-open word.

Step 5: Below the "Good Morning-etc." Greetings will be the template section, click on "More Templates" and head to "Personal" Section, Open the file and it should automatically save, Do the work-around I suggested.

Macro/ VBA Used:

    Dim srNo As String
    srNo = InputBox("Enter Experiment No.:", "New Document")
    ' Only Edit the "Enter Exp No.: " if needed.
    
    If srNo = "" Then Exit Sub
    
    Dim defaultName As String
    defaultName = "YourExpName" & srNo & "-YourID.docx"
    
    Dim saveFolder As String
    saveFolder = "OneDrive Folder Path"
    
    ' Since the post is for OneDrive Sync i.e One-Drive Path
    ' Create the folder if it doesn't exist yet
    If Dir(saveFolder, vbDirectory) = "" Then
        MkDir saveFolder
    End If
    
    ActiveDocument.SaveAs2 FileName:=saveFolder & defaultName, _         
       FileFormat:=wdFormatXMLDocumentPrivate Sub Document_New()
End Sub

If anyone has a better way to do it please comment on this post

reddit.com
u/Small-Heron-6799 — 4 days ago

Can anyone suggest me a good haircut which will suit on my face shape?

Tbh this mullet kinda doesn't kinda suit me plus my hair aren't that wavy or silky due to the indian-kokan genetics I guess

u/Small-Heron-6799 — 21 days ago

Am I doing the right thing.

So, I'm currently in college, and like abh mai 2nd year mai hu, but I've been lately building a website which has the assignments and materials needed for the juniors (Hamare college mai online hota hai submission) so like yeh saali faculty waise bhi marks honestly fairly deti hai nhi, so I thought to yk just pirate my assignments n stuff for the juniors taaki woh zyada apni ghase nahi, Is it a good decision. hamare ko koi mila nhi so maybe it shouldn't be the same for others ek toh assignments karne mai jaan chali jaati.

pata hai aaj kya hua

reddit.com
u/Small-Heron-6799 — 28 days ago

Do Tea in One story lol (Exam Edition)

Pata hai aaj kya hua so meri aaj toh meri aaj exam thi alr I reached college and like blah blah baitha n stuff so isme aaj do departments ko collab karwaye the CO (Computer Engineering) and IF (Information Technology) im on the right side they're on the left, now exam start hua and I guess 10-20 mins hue us beech ek ladki (IF) ki piche waale ka copy krri thi and phir ACHANAK se ruk gyi head down kiya n stuff, teacher aayi to check toh woh halka roni lgi so they brought water n all, baad mai ek teacher aayi and said usko medical condition hai n she got 'panic attack' basically uski paper dekh kr fat gyi SIMPLE lol, and when tr said like "ok I'll let you sit somewhere" she like straight denied and said "I don't wanna even write the exam" and yea she left.

Second, same IF batch lol after 45 mins ek ladki on the front-second bench baithi and exam likh ri in that time the teacher caught a chit from her, exam department bhi monitor krra tha obvsly lol so they LITERALLY came like flash when they checked her slightly 4 AUR chit mile! and like when she started walking 5 chit AUR GIRE! there were more in her shoes too lol xD but yea now i dont think they'll report her to msbte aur ig do ion know

reddit.com
u/Small-Heron-6799 — 2 months ago