4/1/2024 0 Comments Make a new window api vba![]() The reason for the error is that this code is running in Excel, so if objWord is not used for Word syntax, and both Word and Excel use the same name for an object, VBA will try to use the Excel object model. There are a number of factors in play with this code that will or might cause problems. The requested member of the collection does not exist. ![]() Selection.MoveLeft Unit:=wdCharacter, Count:=2 Selection.PasteAndFormat (wdFormatOriginalFormatting) Selection.GoTo What:=wdGoToBookmark, Name:="" IntChoice = Application.FileDialog(msoFileDialogOpen).ShowĪnd here it breaks :( Windows(FileName).Activate Set objWord = CreateObject("Word.Application")Īpplication.FileDialog(msoFileDialogOpen).AllowMultiSelect = False "FileWithData" could be any file and that is the reason I am using OpenDialog.Įverything is working but I am stuck when it comes to Activating "FileWithData" window to start "Copying and Pasting" process. I am trying to write the VBA code to open a Word Document file ("FileWithData") and copy the information from "FileWithData" into "Template1". I have one Word Document ("Template1") opened already.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |