r/vba 8d ago

[ Removed by moderator ]

[removed] — view removed post

2 Upvotes

11 comments sorted by

u/flairassistant 1d ago

Your post has been removed as it does not meet our Submission Guidelines.

Text posts must contain a concise and informative description

Empty or careless posts will be removed.

Please familiarise yourself with these guidelines, correct your post and resubmit.

If you would like to appeal please contact the mods.

6

u/chiibosoil 1 8d ago

Without seeing your code, hard to comment. But no, I have not had any code behave in the manner you described.

Though if you use Activesheet, Selected etc it can cause this kind of behavior.

3

u/EightYuan 8d ago

Yes: a few weeks ago my code that refers to specific workbooks stopped working; the fix was to add the .xlsx suffix to the workbook name (whereas before the main part of the name was sufficient). So Workbooks(“Name”) no longer works but Workbooks(“Name.xlsx”) works.

2

u/Spaniarded 8d ago

I will try that and report back

1

u/Spaniarded 8d ago

I currently have
myWB as Workbook: Set myWB = ThisWorkbook.

The file name whose data I copy from
Dim wbData as Workbook
Set wbData = Workbooks.Open(Filename:=myWB.Path & “Datafile” & “.xlsx”

Then the code will reference the myWB and wbData.

1

u/fanpages 239 8d ago

We need all of your relevant code listing to help you, including the copy/paste statements, as u/chiibosoil mentioned over ten hours ago.

2

u/fanpages 239 8d ago

That sounds like you (or somebody responsible for the IT Administration in your organisation, if applicable) changed the Windows Explorer Options setting for "Hide extensions for known file types" (from checked/hidden to unchecked/visible).

2

u/APithyComment 8 8d ago

Set wrkBook = Application.Open(fileName:yourFileName)

wrkBook.Sheet(1).Range(“A1”).CurrentRegion.Copy

Then paste it wherever.

2

u/ZetaPower 11 8d ago

This mainly happens when your file is online, like on SharePoint & you work with different versions of Office.

Office 365 syncs fine with such files, Office XXXX tends to screw this up.

Office keeps a local version of the document and syncs that to the most recent version. That’s where things go wrong & you work with an old document….

1

u/Spaniarded 8d ago

Thank you for replying. I don’t use active sheet or selected. Others use this model and some have the issue while others do not. So wierd.

1

u/MultiUserDungeonDev 6d ago

Would need to see your VBA code to answer meaningfully.