Is it possible to implement an export/import feature for the unlocked cells in my Excel file? (Through VBA?)

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have made an Excel application, with protected worksheets and workbook, that I have updated and improved over the last several months, and it continues to evolve as I add more features and code as the need arises. One issue though is that each time I make an updated version, I have to manually copy/paste the data from all unlocked segments into the new file.

I'm hoping that it would be possible to implement an export/import feature in my application such that I would press an export button that would save the unlocked data in a file (perhaps through a "save as" window", and then I would press an import button and select the saved data (perhaps through an "open" window) and have all the data be populated in the correct cells.

If possible, it would be fabulous, and I would highly appreciate the help from the VBA experts here :) 🤗
 
Hi Alex,

Hope you've been well. One of my students mentioned today that after clicking export if they decide to cancel (to go back and make some changes in the file before exporting), the csv file opens up after the folderpicker dialog is closed.

I was just checking the code to see if I could locate and edit/move the related code's position in hopes of preventing the csv file to open, but it's a bit too complex for me 😅.

If it is possible/easy and it won't take too much of your time, would you be able to do the magic?

Thanks much 🤗
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try replacing this line:
VBA Code:
            If .Show <> -1 Then Exit Sub   'Check if user clicked cancel button

With these lines:

VBA Code:
            If .Show <> -1 Then              'Check if user clicked cancel button
                wbExport.Close Savechanges:=False
                Application.ScreenUpdating = True
                Exit Sub
            End If
 
Upvote 0
Fabulous!!! It worked 🍻 Thank you so much and have a great weekend! 🤗

(P.S.
There may be one more little enhancement that I might need, but I'm not 100% sure yet if I'll need it. For the "Info-Setup" sheet, I may need to insert a column (due to some new feature requests) for the next major update of my application (v3.x). If that happens, I was wondering perhaps we could incorporate a column shift mechanism in the code for when people would be importing from the current version (v2.x). For example, I could have a dropdown menu close to the Import button saying "importing from v2.x? yes/no", and if they select "yes", then only the "Info-Setup" columns would need to be shifted. I'll let you know sometime in the next few weeks if this will be needed.)
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,798
Members
449,337
Latest member
BBV123

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