Compile error Question

mayoung

Active Member
Joined
Mar 26, 2014
Messages
257
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Can someone please tell me how I can make this work Thank You?
2509F47B-BDE4-4C32-95BE-68C5498DBA2C.jpeg
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Change the name of your routine to something other than ActiveWorkbook. :)
 
Upvote 0
If the macro is running in this workbook you could try:
workbook.name

Is the workbook called dataminerfile.XML or dataminerfile.XML.xyz?
 
Upvote 0
Change the name of your routine to something other than ActiveWorkbook. :)

I am creating my first Addin and this code is in the addin. How do I refer to the open workbook named DataminerFile.xml I want to make sure this code only runs in this workbook only?
 
Upvote 0
If the macro is running in this workbook you could try:
workbook.name

Is the workbook called dataminerfile.XML or dataminerfile.XML.xyz?

I am creating my first Addin and this code is in the addin. How do I refer to the open workbook named DataminerFile.xml I want to make sure this code only runs when this workbook is active not any other workbook that may be open if the button to run the macro is pressed?
 
Upvote 0
If it's called DataminerFile.xml, then you can use Workbooks("DataminerFile.xml"). If your code also opens the workbook, you could store an object reference to it at that point.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top