Inserting a Spreadsheet into a VBA form control...

Status
Not open for further replies.

pellacad

New Member
Joined
Apr 21, 2002
Messages
9
I need to insert an Excel spreadsheet into a VBA form control...my users will make changes to the data in the spreadsheet and then save the file when they are done.

The name of my spreadsheet form control is "Spreadsheet1"...how would I load my Excel file "XYZ.xls" into this control?

I use the following code to load a spreadsheet into Excel, but I want to load and display an Excel file in a VBA form via the spreadsheet control...

This is my code I use to load a spreadsheet into Excel...

Public xlapp As excel.Application
Public xlbook As excel.Workbook
Public xlbookyesno As String
Public xlfilename As String
Public xlSheet As excel.Worksheet

Set xlapp = CreateObject("Excel.Application")
If xlbookyesno = "yes" Then
Set xlapp = xlbook.Parent
Set xlSheet = xlbook.Sheets("KeyNoteList")
MainEditor.BuildCustomList.Caption = Mid(xlfilename, 1, Len(xlfilename) - 4)
Else
End If

Thank you for your help!

Pete
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Status
Not open for further replies.

Forum statistics

Threads
1,137,207
Messages
5,680,194
Members
419,888
Latest member
Prasad K

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
Top