Excel VBA, error message 4198 when computer is offline

Anonymous
2024-05-28T14:43:33+00:00

Hello, I have an Excel document with a macro that opens a word-file. The macro runs fine in online mode and in offline mode when Word-document is stored on USB. I get error message 4198 'Command failed' when computer is offline and Word file is saved on desktop/document folder.

Macro code (red/bold text generate 4198)

Set WordApp = CreateObject("word.Application")

WordApp.Documents.Open FileNameTemplate

Your help is highly valued!

Regards Wilhelm

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Anonymous
    2024-05-29T09:14:46+00:00

    Hello, the problem remains when I sun macro step by step in Local Window.

    0 comments No comments
  2. Anonymous
    2024-05-29T09:24:12+00:00

    It is debug step.

    Check the value difference when you are online and offline.

    Image

    0 comments No comments
  3. Anonymous
    2024-05-29T11:35:58+00:00

    Hello, I tested accordingly and found that the directory is equal in offline/online mode.

    0 comments No comments
  4. Anonymous
    2024-05-29T11:47:55+00:00

    I want to add the following:

    Initially, I received complaints from co-workers with Windows 11 when they run the macro in question offline.

    I have Windows 10. A few months ago, I tested running the macro offline without problems. Recently, I have encountered same issue also on my computer with Windows 10 in offline mode. Perhaps the problem is caused by an update?

    I find it strange that it's possible to run macro in offline mode when Word-file is stored on USB drive.

    Regards Wilhelm

    0 comments No comments
  5. Anonymous
    2024-05-29T11:49:51+00:00

    I'd suggest you create a support ticket to Microsoft for bugs comes from update.

    Please contact your admin/IT department create a support ticket via Microsoft 365 Admin Center> Support> New service request. Support team there will have the correct channel and resources to help you investigate more and find what exactly the reason has caused this situation.

    Get support - Microsoft 365 admin | Microsoft Learn

    About how to find the admin in your organization, you can refer to How do I find my Office 365 admin

    0 comments No comments