Source file cannot be opened generated.h

When I compile a C++ file or create a new C++ file, I often fail to include generated.h.
Try Generate VisualStudio Project File
Deleting the Intermediate,Saved folder and running the Generate VisualStudio Project File did not fix the problem.
This makes it impossible to launch UE4 from either the solution or from the uproject.
What is the solution?

You have to write the #include “____.generated.h” if it’s not there and if you are using Unreal Macros for the class/struct(e.g. UCLASS, USTRUCT, etc)
Even if the generated.h is in red line, once you run the Unreal Header Tool, the generated file should be created.

Please post screenshots if you still have issues compiling.

Thank you for your reply.
Apparently, IntelliSense was freaked out and all the files with .generated were showing red lines.
The error itself was a mistake on my part, as it occurred elsewhere and there was no red line in it.